Sign in
ploeh blog
Mark Seemann's discontinued .NET blog.
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
Component Development
Dependency Injection
Enterprise Library
Miscellaneous
Pages
Productivity
Services
Software Design
Unit Testing
Browse by Tags
MSDN Blogs
>
ploeh blog
>
All Tags
>
dependency injection
Tagged Content List
Blog Post:
An Overview of Unit Testing Duplex WCF Services and Clients
ploeh
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...
on
12 Jul 2008
Blog Post:
Unit Testing Duplex WCF Clients
ploeh
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...
on
8 Jul 2008
Blog Post:
Modifying Behavior of WCF-Free Service Implementations
ploeh
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...
on
27 Jun 2008
Blog Post:
Provider Injection With Funcs
ploeh
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...
on
25 Mar 2008
Blog Post:
TechEd Sessions Sample Code
ploeh
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...
on
8 Nov 2007
Blog Post:
Speaking at TechEd Developers 2007
ploeh
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...
on
10 Oct 2007
Blog Post:
User Context
ploeh
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...
on
20 Aug 2007
Blog Post:
Call Contexts vs. ASP.NET
ploeh
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...
on
28 Jul 2007
Blog Post:
Ambient Context
ploeh
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...
on
23 Jul 2007
Blog Post:
State Your Dependency Intent
ploeh
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...
on
2 Jun 2007
Blog Post:
Code As Dependency Configuration
ploeh
In his article on Inversion of Control and Dependency Injection , Martin Fowler has a quite interesting section towards the end where he talks about how to configure loosely coupled systems. One of his points is that in some cases, it makes more sense to tie it all together using code than by using a...
on
30 May 2007
Blog Post:
Testing Against The Passage of Time
ploeh
This is the fourth in a small series of posts about testing against non-determinism. In this installation, I'm going to cover the passage of time. In my former post , I demonstrated how you can use the Provider Injection pattern to decouple your test target from a direct dependency of the current...
on
14 May 2007
Blog Post:
Testing Against The Current Time
ploeh
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 vary according to the time you run your tests....
on
12 May 2007
Blog Post:
Testing Against Randomness
ploeh
This is the first in a small series of posts about testing against non-determinism. In this installation, I'm going to cover randomness. When code paths are selected at random, the outcome of a unit test may not be deterministic. Consider this example: public bool DoRandomStuff() { Random r = new...
on
11 May 2007
Blog Post:
Provider Injection
ploeh
In his article Inversion of Control Containers and the Dependency Injection pattern , Martin Fowler describes four types of inversion of control: Constructor Injection Property Injection Interface Injection Service Locator Constructor injection and service locator are, in my opinion...
on
25 Mar 2007
Blog Post:
Service Locator 2 Released
ploeh
After far too much delay, today I have finally released Service Locator 2 to the web. Since GotDotNet is being phased out, I have moved the project to CodePlex , which means that you should go to Service Locator's new home to download the new release. So, what is it? Service Locator 2 addresses late...
on
15 Mar 2007
Blog Post:
Console Unit Testing
ploeh
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 utility for a complex piece of software you are...
on
21 Oct 2006
Blog Post:
Unit Testing A CAB Controller
ploeh
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 layers is to enable unit testing of the Controller...
on
5 May 2006
Blog Post:
Cutting CAB The Other Way
ploeh
The Composite UI Application Block (CAB) is a pretty nice piece of technology that allows you to separate user interface code from user interface process code, following some variant of the Model View Controller (MVC) pattern. The QuickStarts that ship with CAB demonstrate how to use different features...
on
4 May 2006
Blog Post:
Service Locator 1.1 Available
ploeh
A new version of the Service Locator Enterprise Application Block is now available. At version 1.1, not much is new: I've added a method which allows a developer to clear all injected services from the InjectionServiceProvider. The idea is that, in unit testing, all tests should be independent, so you...
on
5 Jan 2006
Page 1 of 1 (20 items)