Created
February 11, 2010 23:12
-
-
Save mxriverlynn/302095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeNewCode | |
{ | |
private ISomeOldCode {get; set; } | |
public SomeNewCode(ISomeOldCode someOldCode) | |
{ | |
SomeOldCode = someOldCode; | |
} | |
} | |
public interface ISomeOldCode | |
{ | |
public void DoSomething(); | |
} | |
public class SomeOldCodeAdapater: ISomeOldCode | |
{ | |
public void DoSomething() | |
{ | |
SomeOldCode.DoSomething(); | |
} | |
} | |
public static class SomeOldCode | |
{ | |
public static void DoSomething() | |
{ | |
... the real work happens here, but it's in a static method / object, so it needs a safety barrier between it and the code that wants to be unit tested, above. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment