Skip to content

Instantly share code, notes, and snippets.

@mxriverlynn
Created February 11, 2010 23:12
Show Gist options
  • Save mxriverlynn/302095 to your computer and use it in GitHub Desktop.
Save mxriverlynn/302095 to your computer and use it in GitHub Desktop.
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