예제 #1
0
        private void NaNQuantity()
        {
            // Arrange
            Ingredient ingredient = new Ingredient(double.NaN, 100);

            // Act
            bool isValid = Calculator.IsQuantityValid(ingredient);

            // Assert
            Assert.False(isValid, "Validation error!");
        }
예제 #2
0
        public void NaNUnknownQuantity()
        {
            // Arrange
            Ingredient ingredient = new Ingredient(double.NaN, 100, true);

            // Act
            bool isValid = Calculator.IsQuantityValid(ingredient);

            // Assert
            Assert.True(isValid, "Validation error!");
        }
예제 #3
0
        public void ZeroQuantity()
        {
            // Arrange
            Ingredient ingredient = new Ingredient(0, 100);

            // Act
            bool isValid = Calculator.IsQuantityValid(ingredient);

            // Assert
            Assert.False(isValid, "Validation error!");
        }