Esempio n. 1
0
        public void RemoveSubScope()
        {
            //Arrange

            TECTypical typical = new TECTypical();

            bid.Systems.Add(typical);

            TECEquipment typEquip = new TECEquipment();

            typical.Equipment.Add(typEquip);

            TECSubScope subScope = ModelCreation.TestSubScope(bid.Catalogs, rand);

            subScope.AssignRandomScopeProperties(bid.Catalogs, rand);
            typEquip.SubScope.Add(subScope);

            typical.AddInstance();

            MaterialSummaryVM matVM = new MaterialSummaryVM(bid, cw);

            CostBatch initial = MatVMToCostBatch(matVM);

            //Act
            typEquip.SubScope.Remove(subScope);

            //Assert
            AssertMaterialVMMatchesCostBatch(matVM, initial - subScope.CostBatch);
        }
Esempio n. 2
0
        public static TECSubScope TestSubScope(TECCatalogs catalogs, Random rand)
        {
            TECSubScope ss = new TECSubScope();

            ss.Description = "Test SubScope";
            ss.AssignRandomScopeProperties(catalogs, rand);
            List <IEndDevice> endDevs = new List <IEndDevice>(catalogs.Devices.RandomElements(rand, false, 5));

            endDevs.AddRange(catalogs.Valves.RandomElements(rand, false, 5));
            endDevs.ForEach(dev => ss.Devices.Add(dev));
            rand.RepeatAction(() => ss.Points.Add(TestPoint(rand)), 5);
            rand.RepeatAction(() => ss.Interlocks.Add(TestInterlock(catalogs, rand)), 5);
            rand.RepeatAction(() => ss.ScopeBranches.Add(TestScopeBranch(rand, 1)), 5);
            return(ss);
        }