public void GivenSubAssembly_WhenDeriving_ThenRequiredRelationsMustExist() { var builder = new SubAssemblyBuilder(this.DatabaseSession); var subAssembly = builder.Build(); Assert.IsTrue(this.DatabaseSession.Derive().HasErrors); this.DatabaseSession.Rollback(); builder.WithName("SubAssembly"); subAssembly = builder.Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); }
public void GivenNewSubAssembly_WhenDeriving_ThenInventoryItemIsCreated() { var subAssembly = new SubAssemblyBuilder(this.DatabaseSession) .WithName("SubAssembly") .Build(); this.DatabaseSession.Derive(true); Assert.AreEqual(1, subAssembly.InventoryItemsWherePart.Count); Assert.AreEqual(new Warehouses(this.DatabaseSession).FindBy(Warehouses.Meta.Name, "facility"), subAssembly.InventoryItemsWherePart.First.Facility); }
public void GivenSubAssembly_WhenBuild_ThenPostBuildRelationsMustExist() { var subAssembly = new SubAssemblyBuilder(this.DatabaseSession) .WithName("subAssembly") .Build(); Assert.AreEqual(new InventoryItemKinds(this.DatabaseSession).NonSerialized, subAssembly.InventoryItemKind); Assert.AreEqual(new InternalOrganisations(this.DatabaseSession).FindBy(InternalOrganisations.Meta.Name, "internalOrganisation"), subAssembly.OwnedByParty); }