public void GivenOrderStatusWhenValidatingThenRequiredRelationsMustExist() { var builder = new SalesOrderStatusBuilder(this.DatabaseSession); var orderStatus = builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); builder.WithSalesOrderObjectState(new SalesOrderObjectStates(this.DatabaseSession).Provisional); orderStatus = builder.Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); }
private void DeriveCurrentObjectState(IDerivation derivation) { if (this.ExistCurrentObjectState && !this.CurrentObjectState.Equals(this.LastObjectState)) { var currentStatus = new SalesOrderStatusBuilder(this.Strategy.Session).WithSalesOrderObjectState(this.CurrentObjectState).Build(); this.AddOrderStatus(currentStatus); this.CurrentOrderStatus = currentStatus; } }