An Overview of Unit Testing Duplex WCF Services and Clients

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. The main goal was to ensure testability of implementations of both service and client….


Unit Testing Duplex WCF Clients

In my previous post, I explained how to unit test a WCF service with callbacks. Since the scenario involves duplex communication, the service is also a client, and vice versa, so it’s only reasonable to look at the ‘client’ as well, to examine how to best approach unit testing such a beast. Since both ends…


Modifying Behavior of WCF-Free Service Implementations

In my previous post, I explained how to implement a WCF service without referencing WCF. In simple cases, it works as described, but you may soon find yourself in a situation where you need to modify the behavior of the service when it’s hosted by WCF. Perhaps you need to control the service’s ConcurrencyMode, or…


Provider Injection With Funcs

Some of the new stuff in .NET 3.5 makes it much easier to implement Provider Injection. If you take a close look at the provider definition, you may discover that when used with Provider Injection, only a single method (Create, or something similarly named) is ever used by the consumer. As such, what we have…


TechEd Sessions Sample Code

Now that both of my TechEd sessions are over, I’ve had some request for the sample code that I demonstrated at both sessions. The sample code I used at the interactive talk on TDD is attached to this post. The code I demonstrated at my talk on manual and dynamic mocks is available upon request….


Speaking at TechEd Developers 2007

Again this year, I’ll be presenting at TechEd Developers in Barcelona next month. This year, I’ll be doing both a general session on mocks, as well an interactive session on TDD. You can read more on these sessions by using the conference’s Session Search tool and selecting my name (Mark Seemann) in the Speakers dropdown…


User Context

Besides logging, one of the most common types of ambient context is the user. Who is the user? Was the user authenticated? What is the user allowed to do? Since being able to answer these questions are such common requirements in software development, the BCL includes the IPrincipal interface that allows you to create implementations…


Call Contexts vs. ASP.NET

In my former post on Ambient Contexts, I described how you can use CallContext or Thread Local Storage (TLS) to store a context that is specific to the current context of a call. As it turns out, ASP.NET uses a threading model that disables this approach, since you are not guaranteed that a single request will…


Ambient Context

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 already takes this approach: Security can be handled by reading or writing to Thread.CurrentPrincipal Logging can be handled…


State Your Dependency Intent

There are several different ways to implement Dependency Injection (DI), and Martin Fowler describes four of them in his excellent article on IoC/DI. In this article, the first three approaches (Constructor, Property, and Interface Injection) are mainly described as a background for introducing the Service Locator pattern. In Fowler’s example, a generic Service Locator is a…