I am a huge fan of what Roy Osherove calls "Fast Integration Testing." This is integration testing that:
Given a VS 2010 solution with several WCF services to be integration tested, I've been researching how best to go about this. My further requirements of the test setup are:
Monitor.Wait
to ensure async work is completed before the test exits. For multi-process hosting and testing, I likely must rely on the file system and file system events to achieve the same synchronization.I want to list my findings so far, and ask what tool(s) or technique(s) I'm missing. Again, this question pertains to Visual Studio 2010, though additional comments about 2012 are welcome.
For in-memory solutions, it seems there are two fundamental choices. Either use one instance of a custom ServiceHost for each service, or use one of a variety of other self-hosting tools. In that second link, the original question was about production hosting - but most of the listed tools are capable of self or in-memory hosting.
The author of CassiniDev, mentioned in the second link above, suggested CassiniDev is used when loopback-testing (localhost) is not sufficient. In my case, I suspect loopback-testing is fine. That author suggests that when loop-back testing is ok, then a more lightweight story is to use his WebDevServer code. If I understand correctly, the WebDevServer code is actually internal Visual Studio code that he reflected and modified for test-fixture self-hosting purposes.
For on-box (multi-process) solutions, I see there is a way to make Cassini fit the 64 bit requirement. Otherwise, for IIS Express or IIS, I'm not sure about developer-to-developer configurability issues. Normally when a developer configures IIS Express or IIS on a specific machine, usually other developers are left without that config info and are struggling to make the test work on their own box. I've seen developers produce scripts that use appcmd.exe to automate such configuration, but all too often such scripts are poorly maintained. I want to try to avoid that scenario.
In either scenario, I believe my option(s) for automating the web.config transform (XDT), without a deploy, is discussed here.
Ok, what are the better strategies and tactics? I'd like to know...
Usually, integration testing is done after unit testing to ensure all the units work in harmony with each other. It is also done when support libraries are used along with the code.
Some different types of integration testing are big-bang, mixed (sandwich), risky-hardest, top-down, and bottom-up. Other Integration Patterns are: collaboration integration, backbone integration, layer integration, client-server integration, distributed services integration and high-frequency integration.
This doesn't answer the question of fast integration testing as the asker requested, but the link below is the most comprehensive guide on how to make WCF testable.
https://codereview.stackexchange.com/questions/33379/make-wcf-service-testable?newreg=016e2809b68248958ff3c45973efe643
However, I cannot vouch for how far this guide will take you in terms of developing tests for the full stack of WCF functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With