Пример #1
0
        public void call_to_CreateProductX_method_should_return_productX()
        {
            IAbstractFactory factory = new ConcreteFactory();

            IAbstractProductX productX = factory.CreateProductX();

            Assert.AreEqual("Called: ConcreteProductX", productX.feature());
        }
Пример #2
0
        public void call_to_createProductX_overridden_method_should_return_new_productX()
        {
            IAbstractFactory myFactory = new MyConcreteFactory();

            IAbstractProductX myProduct = myFactory.CreateProductX();

            Assert.That(myProduct.feature(), Is.EqualTo("Called: MyProductX"));
        }