public static void Main()
var class1 = new MyClassThatNeedsToBeTested();
Console.WriteLine(class1.DoMyLogicStuff());
public class TheUnInjectable
public string DoMyStuff()
return "The Un Injectable Stuff";
public interface IDoUnInjectableStuff
public class ForceInjectableFacade : IDoUnInjectableStuff
private readonly TheUnInjectable _theUnInjectable;
public ForceInjectableFacade(TheUnInjectable theUnInjectable)
this._theUnInjectable = theUnInjectable;
public string DoMyStuff()
return this._theUnInjectable.DoMyStuff();
public class MyClassThatNeedsToBeTested
private readonly IDoUnInjectableStuff _injectableStuff;
public MyClassThatNeedsToBeTested(IDoUnInjectableStuff injectableStuff = null)
this._injectableStuff = _injectableStuff ?? new ForceInjectableFacade(theUnInjectable: new TheUnInjectable());
public string DoMyLogicStuff()
var result = string.Empty;
result += "Super Logic happening.";
result += this._injectableStuff.DoMyStuff();
result += "Super Logic Ending";