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

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

            var result = validator.Validate(order);

            Assert.True(result.IsValid);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }