Tag: Unit Testing

  • 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);…

  • Unit Testing HandleErrorAttribute

    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

    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

    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

    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?

    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

    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…