public void GivenEmploymentAgreement_WhenDeriving_ThenRequiredRelationsMustExist() { var builder = new EmploymentAgreementBuilder(this.DatabaseSession); builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); builder.WithFromDate(DateTimeFactory.CreateDate(2010, 12, 31)); builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); this.DatabaseSession.Rollback(); builder.WithDescription("employment agreement"); builder.Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); }
public void GivenEmploymentAgreement_WhenDeriving_ThenRequiredRelationsMustExist() { var builder = new EmploymentAgreementBuilder(this.Session); builder.Build(); Assert.True(this.Session.Derive(false).HasErrors); this.Session.Rollback(); builder.WithFromDate(DateTimeFactory.CreateDate(2010, 12, 31)); builder.Build(); Assert.True(this.Session.Derive(false).HasErrors); this.Session.Rollback(); this.Session.Rollback(); builder.WithDescription("employment agreement"); builder.Build(); Assert.False(this.Session.Derive(false).HasErrors); }