コード例 #1
0
        public void ShouldBeAInvalidItemByZeroedPrice()
        {
            //Arrange
            var item = FakerItem.GetInvalidSampleByZeroedPrice();

            //Act
            var itemTest = item.IsValid();

            //Assert
            itemTest.Should().BeFalse();
        }
コード例 #2
0
        public void ShouldBeAValidItem()
        {
            //Arrange
            var item = FakerItem.GetSample();

            //Act
            var itemTest = item.IsValid();

            //Assert
            itemTest.Should().BeTrue();
        }
コード例 #3
0
        public void ShouldBeSuccessToAddItem()
        {
            //Arrange
            var order = FakerOrder.GetSample();
            var item  = FakerItem.GetSample();

            //Act
            order.AddItem(item);
            var orderTest = order.IsValid();

            //Assert
            orderTest.Should().BeTrue();
            order.Items.Should().HaveCount(1);
        }
コード例 #4
0
        public void ShouldInvalidToAddItemWithOrderNoPending(EOrderStatus status)
        {
            //Arrange
            var order      = FakerOrder.GetSampleWithStatusEqualsTo(status);
            var countItems = order.Items.Count();
            var item       = FakerItem.GetSample();

            //Act
            order.AddItem(item);
            var orderTest = order.IsValid();

            //Assert
            orderTest.Should().BeFalse();
            order.Items.Should().HaveCount(countItems);
        }