public void TC05_MyClassVb_Call2StubMySubClass_SetterDependencyInjection_UnitTest() { string _VarStringMySubClass = ""; MyClassVb _Target = new MyClassVb(new MySubClassVb()); // First set constructor DI to the MySubClass _VarStringMySubClass = _Target.CallMySubClass(); Assert.AreEqual("From MySubClassVb", _VarStringMySubClass, "_VarStringMySubClass=" + _VarStringMySubClass); _Target.SetIMyClassSub(new StubMySubClassVb()); // Then overide the constructor DI with the setter DI to stub _VarStringMySubClass = _Target.CallMySubClass(); Assert.AreEqual("From StubMySubClassVb", _VarStringMySubClass, "_VarStringMySubClass=" + _VarStringMySubClass); }
public void TC04_MyClassVb_Call2StubMySubClass_ConstructorDependencyInjection_UnitTest() { string _VarStringMySubClass = ""; MyClassVb _Target = new MyClassVb(new StubMySubClassVb()); _VarStringMySubClass = _Target.CallMySubClass(); Assert.AreEqual("From StubMySubClassVb", _VarStringMySubClass, "_VarStringMySubClass=" + _VarStringMySubClass); }
public void TC01_MyClassVb_Call2MySubClass_DefaultConstructor_UnitTest() { string _VarStringMySubClass = ""; MyClassVb _Target = new MyClassVb(); _VarStringMySubClass = _Target.CallMySubClass(); Assert.AreEqual("From MySubClassVb", _VarStringMySubClass, "_VarStringMySubClass=" + _VarStringMySubClass); }