Exemple #1
0
        public void BIngredientWithValidMembers_WhenCreateValidated_ReturnsTrue()
        {
            //Arrange: a ingredient with all valid members is created.
            BIngredient ingredient = new BIngredient {
                Long_Name = "Long",
                Short_Name = "SN"
            };

            //Act: The ingredient is checked if it is create valid.
            bool valid = ingredient.CreateValid();

            //Assert: The ingredient is valid for creation.
            Assert.AreEqual(true, valid);
        }
Exemple #2
0
        public void BIngredientWithInvalidMembers_WhenCreateValidated_ReturnsFalse()
        {
            //Arrange: a ingredient with all invalid members is created.
            BIngredient ingredient = new BIngredient{
                Long_Name = "1234567890123456789012345678901234567890",
                Short_Name = null
            };

            //Act: The ingredient is checked if it is create valid.
            bool valid = ingredient.CreateValid();

            //Assert: The ingredient is not valid for creation.
            Assert.AreEqual(false, valid);
        }