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 [...]
Posts Tagged ‘Unit Testing’
A Strategic Case for Unit Testing
Filed under: Popular, Technology | Tags: Popular, Strategy, 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
Filed under: Technology | Tags: CodeSmith, Insight, Unit Testing
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); [...]
Unit Testing HandleErrorAttribute
Filed under: Technology | Tags: ASP.NET, MVC, Unit Testing
Code Analysis doesn’t like the former MVC pattern of using a catch for all errors when updating a model. I wanted to use the HandleError attribute to deal with errors, but how should I unit test it? There are several keys to having the HandleError attribute work: Must decorate the Action with [HandleError] Must have [...]
SmtpClient.Dispose() Bummer
Filed under: Technology | Tags: .NET 4.0, Code Analysis, Unit Testing
Headline: You will need to put in some try/catch logic when you call dispose on the SmtpClient. I was working on getting rid of some of my code analysis warnings – “Warning 10 CA2000 : Microsoft.Reliability : In method ‘AccountMembershipService.SendActivationEmail(HttpContextBase, string, Guid, string, string)’, object ‘client’ is not disposed along all exception paths. Call System.IDisposable.Dispose [...]
Silverlight 5 Announcement
Filed under: Technology | Tags: 64-bit, MVVM, Silverlight, Unit Testing
I was glad to see Scott Guthrie’s blog post Announcing Silverlight 5 posted last Thursday. If you have read my recent posts you know there are many points of Silverlight that have disappointed me. As someone that only has 64-bit computers, believes in TDD (Test Driven Development), and appreciates the MVVM (Model-View-ViewModel) pattern, Silverlight seems [...]
MVC Team Should Rule
Filed under: Technology | Tags: EF, Moq, MVC, Silverlight, Unit Testing
Headline: I don’t think I’ve seen a team more focused on testability at Microsoft than the ASP.NET MVC (Model-View-Controller) team. I sure hope their unit testing philosophy starts to influence other teams more. Entity Framework If you use any of the patterns for the Entity Framework (one of the early versions of .NET 4.0 that [...]
No Silverlight Unit Test Integration with TFS?
Filed under: Technology | Tags: Silverlight, TFS, Unit Testing
Well, the excitement of the last post lasted about 18 seconds. Now I need to slog through this post about “Integrating Silverlight Unit Tests into Build Process”. Must Use Silverlight Unit Tests In the last post I was doing unit testing with a regular unit test project. That integrates with TFS (Team Foundation Server) quite [...]
Reusable Library Naming
Filed under: Technology | Tags: .NET 4.0, MVVM, Silverlight, TFS, Unit Testing
I plan to call my projects KarlZ.Silverlight.* while the assemblies they produce will be called KarlZ.*. Then I’ll link from the Silverlight project to the existing files in the normal .NET projects. The Problem – Different CLRs I’d like to use both MVC (Model-View-Controller) and Silverlight presentation tiers. My development and test environment for MVC [...]