Beispiel #1
0
        public void GivenProduct_WhenThePriceIsNegative_IsFailed()
        {
            // Arrange
            var product = new Product("dammy name", -10);
            var spec    = new IsPriceValidSpec();

            // Act
            var result = spec.IsSatisfiedBy(product);

            // Assert
            Assert.False(result);
        }
        public void GivenDiscount_WhenThePriceIsNegative_IsFailed()
        {
            // Arrange
            var discount = new Discount(Guid.NewGuid(), 1, -10);
            var spec     = new IsPriceValidSpec();

            // Act
            var result = spec.IsSatisfiedBy(discount);

            // Assert
            Assert.False(result);
        }
Beispiel #3
0
        public void GivenProduct_WhenThePriceIsValid_IsSuccessful()
        {
            // Arrange
            var product = new Product("dammy name", 10);
            var spec    = new IsPriceValidSpec();

            // Act
            var result = spec.IsSatisfiedBy(product);

            // Assert
            Assert.True(result);
        }
        public void GivenDiscount_WhenThePriceIsValid_IsSuccessful()
        {
            // Arrange
            var discount = new Discount(Guid.NewGuid(), 1, 10);
            var spec     = new IsPriceValidSpec();

            // Act
            var result = spec.IsSatisfiedBy(discount);

            // Assert
            Assert.True(result);
        }