Every unit testing framework out there comes with a plethora of assertion methods - this is not necessarily a good thing. Instead of writing simple code a developer is forced to choose the correct assertion method from a seemingly endless list of methods, most of which look exactly the same! Having multiple overloaded methods with … Continue reading Assert.AreEqual in MSTest – done right
Tag: Tips and Tricks
How to write a unit test
Last week I had the pleasure of participating in Sela Developer Practice. Before my session I sat through Gil ZIlberfeld’s session “7 steps for writing your first unit test” and I found myself thinking – what are steps I take when writing a new unit test?I’ve been writing them for so long and never noticed … Continue reading How to write a unit test
The evolution of a task board
I’d like to tell you a story about how we manage tasks in my team… Once upon a time (about a year and a half ago) I’ve started working in a new place. Since I’ve came from a company with very strong agile practice I wanted my new work place to be as agile as … Continue reading The evolution of a task board
Enabling parameterized tests in MSTest using PostSharp
I have blogged about the shortcoming of Microsoft’s unit testing framework in the past. It has very good Visual Studio (and TYFS) integration out of the box but it seems that in order to use it I have to suffer lack of functionality I’m used to taking for granted when using any other .NET unit … Continue reading Enabling parameterized tests in MSTest using PostSharp
Supercharge Isolate.Verify
At work we use Typemock Isolator for all of our Isolation/Mocking needs. Lately I’ve noticed that my co-workers do not like to use verify. One of the reasons they prefer not to use it is that sometime Verify error messages leave much to be desired. There are a few simple tricks that helps Isolator help … Continue reading Supercharge Isolate.Verify
How to ignore thrown exceptions
Yesterday I came across this question on StackOverflow:Is there a better way to ignore an exception in C# than putting it up in a try catch block and doing nothing in catch? I find this syntax to be cumbersome. For a code block, can't I simply "tag" it in such a way so as runtime … Continue reading How to ignore thrown exceptions
Find out where is the method that was called unexpectedly using fake objects
Every Isolation/Mocking framework out there can verify that a method of a fake object was called and not less important make sure that certain methods are not called. Let’s say that I want to make sure that a method didn’t encounter any errors during execution but verifying that logger.Error was not called: [TestFixture]public class MyClassTests{ … Continue reading Find out where is the method that was called unexpectedly using fake objects
15 Resharper keyboard shortcuts you need to know
I use Resharper daily and it help me to write better code faster. The only downside is that the developer needs to learn many keyboard shortcuts in order to properly use its functionality. While I'm still learning new shortcuts every day I've found that I keep using several shortcuts most of the time.The list below … Continue reading 15 Resharper keyboard shortcuts you need to know
Typemock Isolator is in Visual Studio Gallery
In case you've never been to Visual Studio Gallery - it is a "one stop shop for Visual Studio extensions. It includes everything from community built power toys to advanced industry partner...". This site is a great resource of visual studio extendibility, you can find many of the tools that most software developers use on … Continue reading Typemock Isolator is in Visual Studio Gallery
Find the difference – spot the bug
Every developer has been at a point when a defect is found in software he has been working on, in fact a major part of every software developer is fixing bugs. A software bug (or just “bug”) is an error, flaw, mistake, failure, fault or “undocumented feature” in a computer program that prevents it … Continue reading Find the difference – spot the bug