Skip to content

Instantly share code, notes, and snippets.

@devdays
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/64be2dcd7677514af80f to your computer and use it in GitHub Desktop.
Save devdays/64be2dcd7677514af80f to your computer and use it in GitHub Desktop.
Alternative way to implement Service, but will not compile
class AlternateService
{
public void Serve()
{
Console.WriteLine("Service Called");
//To Do: Some Stuff
}
}
class TestClient
{
public static Main()
{
// will not compile. Cannot mock out the alternate service
Client client = new Client(new AlternateService());
client.Start();
Console.ReadKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment