Home » Unit testing

Tag Archives: Unit testing

VS2015 Update 1 brings (back) parallel test execution

Yesterday I’ve installed the new VS2015 update and tried to make my machine talk to my win10 (IoT core) Raspberry PI. It didn’t help but that’s a story for another blog post – spoiler: it was a problem with my laptops Ethernet port. After the dust settled I’ve started reading about the new goodness that was just added to my ...

Read More »

Creating a Unit Testing Strategy – Part V

This is the 5th and final part of the series about analyzing what we’re coding, and therefore what to test. Last time, we actually got to writing the tests. Let’s do some cleanup. Step 8: Review Once we have the tests, it’s time to review both the code and tests. But we do those on a couple of levels. At the ...

Read More »

Using a SynchronizationContext in unit tests

We’ve started to use the Progress<T> class in our async application. However our tests started to fail because of that (when validating that our callbacks get invoked). This post will show you how to create a simple  SynchronizationContext to make sure that everything is invoked before the assert part is being run. If you google around you’ll see a couple of articles ...

Read More »

Creating a Unit Testing Strategy – Part IV

This is the 4th part of the series about analyzing our code and deciding what to test. Last time, we talked about design constraints. Now we’re moving towards the code itself. Almost there. Step 6: Prepare existing code This is an obvious step in test-after. We want to test the existing code, and therefore we need to see what we’re testing. In ...

Read More »

Creating a Unit Testing Strategy – Part III

This is the 3rd part of the series about analyzing what we’re coding, and therefore what to test. Last time, we talked about test categorization and design considerations regarding testability. We haven’t touched or written any code yet. Nor will we before the end of this post. Patience is a virtue in both reading and writing tests. Step 5: Identify design ...

Read More »

Creating a Unit Testing Strategy – Part II

This is the 2nd part of the series about analyzing what we’re coding, and therefore what to test. Last time, we talked about the problem we want to test and a solution design. Once we have those, at least in some broad strokes, we can continue. Step 3: Test categorization At this point, after we’ve got a list of test cases ...

Read More »

Creating a Unit Testing Strategy – Part I

This series of posts describes the process I use to decide which tests to write, and how to write them – regarding where if the code already exists or not. This approach works for both TDD and test-after, but it works well where most of the systems are – legacy mode. The process is about understanding the environment and fitting in ...

Read More »

Automocking fields using NUnit

From time to time I get to teach and mentor Java developers on the fine art of unit testing. There are many similarities when unit testing in Java and .NET but more interesting are the differences between the two. Faking objects in Java using Mockito One of the well-used Java Isolation (Mocking) frameworks is called Mockito which is easy to ...

Read More »

ASP.NET Web API Unit Testing

Unit testing can be beneficial to many aspects in software develepment, from the lowest level that is the source code to the highest level and the end user’s experience. Writing automated tests helps finding defects earlier in the development lifecycle process which leads to fewer late nights or weekend work (happier developers). Since defects are resolved before production, less defects ...

Read More »