ploeh blog

Mark Seemann's discontinued .NET blog.

Blog - About

About ploeh blog

Mark Seemann was a software development engineer working for Microsoft in Copenhagen, Denmark. This was his (professional) blog. Please visit the current ploeh blog instead.

All postings are provided "AS IS" with no warranties, and confer no rights. Any opinions expressed in this blog are solely those of the author and not official positions of Microsoft Corporation.

  • ploeh blog

    Console Unit Testing

    • 7 Comments
    In many scenarios, console applications are very useful, but if you have a console application of intermediate complexity, you should obviously unit test it like all the other code you write - right? If you have a console application as an administration...
  • ploeh blog

    Unit Testing WCF Services

    • 15 Comments
    A few years ago, when ASP.NET web services were the only (or at least most common) implementation of web services on the Microsoft platform, you couldn't really unit test services. Obviously, since you had programmatic access (via a proxy class) to the...
  • ploeh blog

    Integration Testing WCF Services

    • 28 Comments
    In my previous post about unit testing WCF services , I hinted at the need to perform integration testing of services as well. As Jimmy writes , you should still place your logic involving OperationContext in the Service Interface Layer (SIL): In many...
  • ploeh blog

    A Generic IAsyncResult Implementation

    • 19 Comments
    Lately, I've found myself writing implementations of IAsyncResult more than once, and as it turns out, all of those implementations have been so similar that I have ended up creating a generic implementation. When implementing the Async Pattern, you...
  • ploeh blog

    Integration Testing Principles

    • 12 Comments
    As I've written before , integration tests are different from unit tests, but that does not mean that unit testing tools such as Visual Studio Team System can't or shouldn't be used to define integration tests. However, many integration tests will, by...
  • ploeh blog

    How To Dispose Members From Forms

    • 19 Comments
    When you create a new Form (or UserControl for that matter), Visual Studio creates it as a partial class, with the designer-generated code going into the *.Designer.cs file. One other piece of code that also goes into the designer code is an override...
  • ploeh blog

    Visual Studio 2008 PowerShell

    • 4 Comments
    Ever since I first saw a demo of PowerShell some five years ago, I've been wanting to use it for development work; such as automating code generation or whatever other task for which small scripts are needed. It's such a powerful environment, and I simply...
  • ploeh blog

    Unit Test Your Enterprise Library Logging Logic

    • 17 Comments
    Most enterprise applications need to perform logging in some form or other, and the Enterprise Library Logging Application Block provides an excellent platform for implementation. With the Logging Application Block (henceforth LAB) you don't have to think...
  • ploeh blog

    Ambient Context

    • 11 Comments
    These days, I'm becoming increasingly enamored with the idea of implementing cross-cutting concerns using Thread Local Storage (TLS) or the current call context. For the most typical aspects of software, such as security and logging, the .NET framework...
  • ploeh blog

    Running MSTest In An MTA

    • 14 Comments
    Writing deterministic, multi-threaded unit tests may not be your idea of a fun Saturday night, but with a little discipline and knowledge, it can be done, and it sure beats writing multi-dreaded code without the safety net provided by an automated test...
  • ploeh blog

    Cleaning Away The TestResults Folder

    • 4 Comments
    When I write code, I usually use the test-driven development approach, which means that I execute a suite of unit tests very often. In Visual Studio 2005, all artifacts of a test run gets copied to a folder beneath the TestResults folder, which is usually...
  • ploeh blog

    Anonymous Variables

    • 7 Comments
    This post is an installment in my series on Zero-Friction TDD . Often when writing a unit test, the SUT 's API will force you to create objects that you really don't care about. As an example, take a look at the signature of this constructor: public...
  • ploeh blog

    ClassCleanup May Run Later Than You Think

    • 5 Comments
    In addition to the well-known TestInitializeAttribute, the Visual Studio Team System unit testing framework also includes both initialization and clean-up attributes for both individual test cases, classes and assemblies. Although the use of these attributes...
  • ploeh blog

    Testing Events Using Anonymous Methods

    • 11 Comments
    If you are unit testing a class which may raise an event, it will be appropriate to test that the event is raised when appropriate. Before .NET 2.0, you had to attach an event handler to an instance of the class to test the event, but now you can do it...
  • ploeh blog

    Installing Event Sources For The Logging Application Block

    • 11 Comments
    One of the nice things about the Enterprise Library Logging Application Block (LAB) is that it's so darned configurable (like the other Enterprise Library Application Blocks). One of the benefits of this is that it makes it rather easy to unit test your...
  • ploeh blog

    An Overview of Unit Testing Duplex WCF Services and Clients

    • 4 Comments
    In the last couple of posts, I've demonstrated how to isolate implementation from WCF contract definition and behavior in a duplex communication scenario. These posts have been rather detailed, so it occurred to me that you might benefit from an overview...
  • ploeh blog

    How Will LINQ Impact Database Development Best Practices?

    • 5 Comments
    Ever since I first heard about the LINQ project , I've been wondering how this would fit in with our best practices for database development. Slowly, I think I've arrived at an interim conclusion. Since this posting deals with future developments in best...
  • ploeh blog

    Unit Testing A CAB Controller

    • 8 Comments
    In my previous post I demonstrated how to create an application based on the Composite UI Application Block (CAB) while truly separating Views from Controllers by placing them in separate assemblies. My main motivation for separating these application...
  • ploeh blog

    Testing Against The Current Time

    • 6 Comments
    This is the third in a small series of posts about testing against non-determinism. In this installation, I'm going to cover how to deal with the current time or date. If you have logic that is dependent of the current time or date, test results will...
  • ploeh blog

    Integration Testing With Certificates

    • 7 Comments
    In my post about integration testing of WCF services , I hinted that one compelling reason to perform integration testing of services would be to test authorization managers or message interceptors. When working with message security, certificates tend...
  • ploeh blog

    Mocking Generic Methods With NMock2

    • 15 Comments
    Recently I was asked how to mock a generic method, now that NMock2 supports generics. Here's how: Suppose you have this interface: public interface IMyInterface { T DoStuff<T>(); } And this class using IMyInterface: public class MyClass...
  • ploeh blog

    N-Tier Synchronization With The Sync Framework And WCF ChannelFactory (Part 1)

    • 2 Comments
    Sync Services for ADO.NET 2.0 allows a proper n-tier architecture where you can synchronize a client with a back-end data store via a web service. To do this, your web service must expose a simple interface consisting of four operations. As described...
  • ploeh blog

    N-Tier Synchronization With The Sync Framework And WCF ChannelFactory (Part 2)

    • 2 Comments
    In my previous post , I discussed using ServerSyncProviderProxy with ChannelFactory<T> , and explained how you can get up and running with that combination. While the described modification is definitely necessary, there's at least one other caveat...
  • ploeh blog

    Unit Testing Duplex WCF Services

    • 5 Comments
    One of my readers recently asked me about unit testing WCF services when they have callbacks. Given that I strongly believe that you should attempt to implement your services without referencing WCF at all , but duplex WCF services require you to get...
  • ploeh blog

    Performance Counter Testing

    • 6 Comments
    If at all applicable, a well-written application should include one or more performance counters, which will enable operations staff (or maintainance developers) to monitor and troubleshoot the application. Since the goal of a performance counter is to...
Page 1 of 6 (132 items) 12345»