I’ve just started yet another pet project and wanted to pick a unit testing framework (.NET). On a soon-to-regret whim I’m tried googling “NUnit vs. XUnit” and read the first 10 posts I got. They were informative and mostly correct, unfortunately all completely missed the one big difference between those two excellent unit testing frameworks… … Continue reading The real difference between NUnit and XUnit
Anyone who ever googled (binged?) about unit testing have heard about the “one assert per test rule”. The idea is that every unit test should have only one reason to fail. It’s a good rule that help me write good, robust unit test – but like all such rules-of-the-thumb it’s not always right (just most … Continue reading Comparing Two objects using Assert.AreEqual()
Looking back at the time wasted yesterday while trying to make a trivial functionality work makes me wonder if it was a good idea to begin with… It all started (and ended) yesterday while I was mentoring a team on the fine art of Java unit testing. We’ve decided to use Mockito’s InjectMocks due to … Continue reading When Mockito’s InjectMocks does not inject mocks
The contract has been signed, the training finished and all the company is ready to start using the best development practices known to man - unit testing, TDD, Clean code, pair programming you name it! But there’s just one problem preventing the change from happening...Or as the good doctor puts it:You can get so confused … Continue reading What are you waiting for???
I’m a long time listener of .NET rocks and today during my drive to work while listening to TDD on .NET and Java with Paul Mooney, Carl mentioned a cool tip I want to share with you. In the past I have use XSD.exe to create classes from XML files for serialization purposes (and similar … Continue reading Visual Studio tip: paste json/xml file as class
Today I had a need to test an action that runs inside a Task: When faced with similar a code a developer has a “tiny” problem – how to force the code inside Task.Run to execute before the end of the test is reached. And so we can write the following test that would fail … Continue reading Unit testing concurrent code using custom TaskScheduler
Two days ago I couldn’t take it anymore…There was a new and shiny (dev) release for my Windows Phone and I just had to install it. With trembling hands and a heavy heart I’ve installed Preview for Developers on my HTC 8x and dived right into the dreaded “download –> install –> reboot” cycle which … Continue reading 3 Windows Phone 8.1 features I’m already using
Last week the company I was employed at went bankrupt. It was the end of a long process which started about a year ago. It was a sad experiencer - I believed in the company and its goals. I hoped that the company’s amazing vision would become reality - and it did for a while. … Continue reading In search of a Better Place
“Choose a number from 1 to 10” – they usually choose 5, I’m not sure why.This how an interview question I’ve used to ask begins…The questionSuppose you’re writing a client that receive a message with a number N (usually 5). Next you’ll receive N messages each contains a different number from 1 to N 1 … Continue reading Are you better at math or code?
You’re lucky you know, said the developer to the consultant. You get to come and save the day and leave before all hell breaks loose. You got it all wrong said the consultant to the developer. I solve problems, teach best practices and explain what should be done and then they change and twist everything … Continue reading The developer’s perspective