Skip to main content

Posts

Showing posts with the label continuous testing

Tricky continuous testing and self hosting WebAPI issue...

When using WebAPI inside a test fixture make sure you shutdown the HttpSelfHostServer instance correctly or your tests will more than likely fail when run from a continuous testing framework like nCrunch. See this post for info about using the self hosting version of WebAPI inside a test fixture. So my tests were running successfully when run inside Visual Studio from either the inbuilt runner or via Reshaper, but were failing when run from nCrunch: The failing tests weren't consistent either, sometimes none would fail, sometimes a couple, sometimes all... What the tests had in common was they were using a shared resource setup inside the test fixture setup method - this is like the setup method for a test but scoped at the class (test fixture) level. The setup was failing randomly were it was setting up the WebAPI self host - see highlighted yellow area, you can see the failing icon for nCrunch at the side: The exception was telling me it was trying to crea...

I no longer build C# apps

Okay so the title is slightly misleading, I'm still writing   code in C# (.Net) but I'm no longer manually building the solution inside Visual Studio, no F5, no Ctrl+Shift+B... You might be thinking huh? What I mean is I no longer go round the continual cycle of  write code, compile code, test code, refactor code etc. We've managed to remove the compile & test  phases from the development process and I can't elaborate how liberating this is. This has been achieved by using a continuous testing framework - tests are executed as you write the code. I found this article back from 2007 stating all the benefits you'll get from using such a framework - ' It’s turning the knob on Test Driven Development up to 11 ' - so true... I'm currently working in an environment where the main constraint is not the tools we're using but the underlying OS. We're stuck with 32 bit Win XP machines for at least the short to medium term and our biggest pro...