• June 2024
    M T W T F S S
  • Latest Posts

  • Latest Comments

  • Archives

Posts Tagged ‘Unit Testing’

Unicorn Series–Automated Testing

Headline: The only real way to be Agile is if you have healthy automated testing. (See Unicorn Series Overview for other topics.) Results Let’s start with some results of the practices described here: Quality: Customer reported bugs range from 1 to 10 per year, despite thousands of users Cost: There is no dedicated testing team […]

Unicorn Series Overview

Headline: All the modern software development practices really do make significant business impact. Contents Automated Testing Disclaimer: As usual, there is not information in this series that would be considered proprietary information for C&C Reservoirs. This is the overview and index for a series on software development practices the team I’m leading has been using […]

How can I unit test unsubscribing from an event? (C#)

I’ve seen some strange bugs that occur when you don’t properly unsubscribe from events. But it seems I’m always stuck when it comes to unit testing that. Well, I use Moq for most of my mocking and there are some techniques you can use for testing that your subscribed, namely by Raise(ing) the event in […]

How to Write Bad C# Code

In case you’re afraid Microsoft might help you write some good C# code, here’s a list of the top tips to make sure you still write bad C# code. Now I’m sure that’s not the objective, but when you read this post you’ll frankly wonder why it is that we still see so much bad […]

Visual Studio 2012 testmc Code Snippet

Headline: This contains the code for the first code snippet I install when I have a new installation of Visual Studio along with the steps to get it into the right location. The Result The first time I saw this format for unit tests was in some work the Microsoft ASP.NET MVC (Model View Controller) […]

Where is TestContext.BeginTimer()?

This post outlines my (with help of others) solution to keeping my unit tests working in the absence of TestContext.BeginTimer() and TestContext.EndTimer(). These seem to be missing in Visual Studio 2012 and I can’t find any posts… so I assume no one else uses this pattern. What’s Broken? Here is a sample unit test that […]

TDD Saves Time When You Need It Most

In the life of a project when is time most precious? The first day? Or the last day? Writing unit tests makes sense, but are you disciplined enough to write them? I understood the value of writing unit tests and had used them on numerous projects. I knew you should write them but I had […]

A Strategic Case for Unit Testing

There is a certain level of velocity and quality that you will never reach without effective unit testing. I’ve had an unusual number of queries about unit testing during the past few days. As a result I thought I would put a more complete description together. Definition I’m not going to spend a great deal […]

Did I Ever Mention I Like TDD?

I’m working to change an older application to one that uses the MVVM (Model-View-ViewModel) pattern. I’m trying to change it one piece at a time, and what a hassle it’s become. I’ve come to the conclusion that a complete re-write is in order. And when I re-write I’ll be using TDD (Test Driven Development). Singe […]

MVC 3 Breaks Error Tracking in CodeSmith Insight

I finally have the Crash Reports working again with CodeSmith’s Insight. The release of MVC 3 provided a new way to deal with errors using the HandleErrorAttribute. The changes to the Global.asax.cs file look something like this: Application_Start     protected void Application_Start()     {         AreaRegistration.RegisterAllAreas();           // Added this when converting to MVC 3         RegisterGlobalFilters(GlobalFilters.Filters);           RegisterRoutes(RouteTable.Routes); […]