예제 #1
0
파일: PartTests.cs 프로젝트: Allors/apps
        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);
        }
예제 #2
0
파일: PartTests.cs 프로젝트: Allors/apps
        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);
        }
예제 #3
0
파일: PartTests.cs 프로젝트: Allors/apps
        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);
        }