public static OrderTermBuilder WithDefaults(this OrderTermBuilder @this)
        {
            var faker = @this.Session.Faker();

            @this.WithTermValue(faker.Lorem.Sentence());
            @this.WithTermType(faker.Random.ListItem(@this.Session.Extent <OrderTermType>()));
            @this.WithDescription(faker.Lorem.Sentence());

            return(@this);
        }
Exemple #2
0
        public void GivenOrderTerm_WhenDeriving_ThenDescriptionIsRequired()
        {
            var builder   = new OrderTermBuilder(this.Session);
            var salesTerm = builder.Build();

            Assert.True(this.Session.Derive(false).HasErrors);

            this.Session.Rollback();

            builder.WithTermType(new OrderTermTypes(this.Session).PercentageCancellationCharge);
            salesTerm = builder.Build();

            Assert.False(this.Session.Derive(false).HasErrors);
        }
Exemple #3
0
        public void GivenOrderTerm_WhenDeriving_ThenDescriptionIsRequired()
        {
            var builder = new OrderTermBuilder(this.DatabaseSession);
            var orderTerm = builder.Build();

            Assert.IsTrue(this.DatabaseSession.Derive().HasErrors);

            this.DatabaseSession.Rollback();

            builder.WithTermType(new TermTypes(this.DatabaseSession).PercentageCancellationCharge);
            orderTerm = builder.Build();

            Assert.IsFalse(this.DatabaseSession.Derive().HasErrors);
        }