static void Main() { ILService pmb = DemoFactoryDesign.GetServiceInstace(0); pmb.GetServiceName(); Console.WriteLine(pmb.GetServiceName()); ILService dedicated = DemoFactoryDesign.GetServiceInstace(1); dedicated.GetServiceName(); Console.WriteLine(dedicated.GetServiceName()); ILService generic = DemoFactoryDesign.GetServiceInstace(3); generic.GetServiceName(); Console.WriteLine(generic.GetServiceName()); }
public void TestingDedicated() { ILService dedicated = DemoFactoryDesign.GetServiceInstace(1); string expected = "Dedicated Services"; var nsub = Substitute.For <ILService>(); nsub.GetServiceName().Returns(expected); Assert.AreEqual(expected: expected, dedicated.GetServiceName()); }
public void TestingGeneric() { ILService generic = DemoFactoryDesign.GetServiceInstace(3); string expected = "Generic Services"; var nsub = Substitute.For <ILService>(); nsub.GetServiceName().Returns(expected); Assert.AreEqual(expected: expected, generic.GetServiceName()); }
public void TestingPMB() { ILService pmb = DemoFactoryDesign.GetServiceInstace(0); string expected = "PMB Services"; var nsub = Substitute.For <ILService>(); nsub.GetServiceName().Returns(expected); Assert.AreEqual(expected: expected, pmb.GetServiceName()); Assert.That(nsub.GetServiceName(), Is.EqualTo("PMB Services")); }