コード例 #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);
        }
コード例 #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);
        }