public static InvoiceTermBuilder WithDefaultsForPaymentNetDays(this InvoiceTermBuilder @this) { var faker = @this.Session.Faker(); @this.WithTermValue(faker.Random.Int(7, 30).ToString()); @this.WithTermType(new InvoiceTermTypes(@this.Session).PaymentNetDays); @this.WithDescription(faker.Lorem.Sentence()); return(@this); }
public static InvoiceTermBuilder WithDefaults(this InvoiceTermBuilder @this) { var faker = @this.Session.Faker(); @this.WithTermValue(faker.Lorem.Sentence()); @this.WithTermType(faker.Random.ListItem(@this.Session.Extent <InvoiceTermType>())); @this.WithDescription(faker.Lorem.Sentence()); return(@this); }
public static InvoiceTermBuilder WithDefaults(this InvoiceTermBuilder @this) { var faker = @this.Session.Faker(); var allInvoiceItemTypes = @this.Session.Extent <InvoiceTermType>().ToList(); var invoiceItemTypes = allInvoiceItemTypes.Except(allInvoiceItemTypes.Where(v => v.UniqueId == InvoiceTermTypes.PaymentNetDaysId).ToList()).ToList(); @this.WithTermValue(faker.Lorem.Sentence()); @this.WithTermType(faker.Random.ListItem(invoiceItemTypes)); @this.WithDescription(faker.Lorem.Sentence()); return(@this); }
public void GivenInvoiceTerm_WhenDeriving_ThenRequiredRelationsMustExist() { var builder = new InvoiceTermBuilder(this.DatabaseSession); var invoiceTerm = builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); builder.WithTermType(new TermTypes(this.DatabaseSession).LateFee); invoiceTerm = builder.Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); }