public void GivenStatementOfWork_WhenDeriving_ThenRequiredRelationsMustExist() { var party = new PersonBuilder(this.Session).WithLastName("party").Build(); this.Session.Commit(); var builder = new StatementOfWorkBuilder(this.Session); builder.Build(); Assert.True(this.Session.Derive(false).HasErrors); this.Session.Rollback(); builder.WithReceiver(party); builder.Build(); Assert.True(this.Session.Derive(false).HasErrors); this.Session.Rollback(); builder.WithFullfillContactMechanism(new WebAddressBuilder(this.Session).WithElectronicAddressString("test").Build()); builder.Build(); Assert.False(this.Session.Derive(false).HasErrors); }
public void GivenStatementOfWork_WhenDeriving_ThenDescriptionIsRequired() { var builder = new StatementOfWorkBuilder(this.DatabaseSession); var statementOfWork = builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); builder.WithDescription("StatementOfWork"); statementOfWork = builder.Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); }