Exemple #1
0
        public void CanValidateOrder()
        {
            var order = new OrderBuilder()
                        .Build();

            var validator = new ValidatorBuilder()
                            .Build();

            var result = validator.Validate(order);

            Assert.True(result.IsValid);
        }
Exemple #2
0
        public void CanValidateInvalidOrder()
        {
            var order = new OrderBuilder()
                        .Build();

            var validator = new ValidatorBuilder()
                            .WithInvalidResults()
                            .Build();

            var result = validator.Validate(order);

            Assert.False(result.IsValid);
        }
Exemple #3
0
        public void CanValidateOrder_WithOrderLine_AndShippingAddress()
        {
            var order = new OrderBuilder()
                        .WithOrderLine()
                        .WithShippingAddress()
                        .Build();

            var validator = new ValidatorBuilder()
                            .Build();

            var result = validator.Validate(order);

            Assert.True(result.IsValid);
        }