Ejemplo n.º 1
0
        public void GivenDiscount_WhenTheQuantityIsNegative_IsFailed()
        {
            // Arrange
            var discount = new Discount(Guid.NewGuid(), -1, 10);
            var spec     = new IsQuantityValidSpec();

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

            // Assert
            Assert.False(result);
        }
Ejemplo n.º 2
0
        public void GivenDiscount_WhenTheQuantityIsValid_IsSuccessful()
        {
            // Arrange
            var discount = new Discount(Guid.NewGuid(), 1, 10);
            var spec     = new IsQuantityValidSpec();

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

            // Assert
            Assert.True(result);
        }