Exemple #1
0
        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());
        }
Exemple #2
0
        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());
        }
Exemple #3
0
        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"));
        }
Exemple #4
0
        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());
        }