public void AlwaysReturnANewShoppingCartInstance()
        {
            // Arrange
            var factory = new CosmeticsFactory();

            // Act
            var firstCart  = factory.CreateShoppingCart();
            var secondCart = factory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOf <IShoppingCart>(firstCart);
            Assert.IsInstanceOf <IShoppingCart>(secondCart);
            Assert.AreNotSame(firstCart, secondCart);
        }
        public void TestCreateShoppingCart_ShouldInitialiseCorrectly()
        {
            var factory = new CosmeticsFactory();
            var cart    = factory.CreateShoppingCart();

            Assert.IsNotNull(cart);
            Assert.IsTrue(cart.GetType().Name == "ShoppingCart");
        }
示例#3
0
        public void CreateShoppingCart_ShouldAlwaysReturnNewShoppingCart_IfMethodIsInvoked()
        {
            //Arrange
            var cosmeticsFactory = new CosmeticsFactory();

            //Act
            var shoppingCart = cosmeticsFactory.CreateShoppingCart();

            //Assert
            Assert.IsInstanceOf <ShoppingCart>(shoppingCart);
        }
        public void Test()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act.
            var actualFactory = cosmeticFactory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOf <IShoppingCart>(actualFactory);
        }
示例#5
0
        public void CreateShoppingCart_ShouldCreateAnInstanceOfShoppingCart_WhenPassedValidInput()
        {
            // Arrange
            var factory = new CosmeticsFactory();

            // Act
            var shoppingCart = factory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOf <IShoppingCart>(shoppingCart);
        }
        public void CreateShoppingCart_WhenInvoked_ShouldReturnInstanceOfShoppingCart()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act
            var executionResult = cosmeticFactory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOf <IShoppingCart>(executionResult);
        }
        public void ReturnInstanceOfTypeShoppingCart()
        {
            // Arrange, Act, Assert
            var factory = new CosmeticsFactory();

            // Act
            var cart = factory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOfType(cart, typeof(IShoppingCart));
        }