Exemple #1
0
        public void RemoveValve()
        {
            //Arrange
            bid.Catalogs.Add(ModelCreation.TestValve(bid.Catalogs, rand));
            ChangeWatcher cw = new ChangeWatcher(bid);

            TECTypical typical = new TECTypical();

            bid.Systems.Add(typical);

            TECEquipment typEquip = new TECEquipment();

            typical.Equipment.Add(typEquip);

            TECSubScope typSS = new TECSubScope();

            typEquip.SubScope.Add(typSS);

            TECValve valve = bid.Catalogs.Valves[0];

            valve.AssignRandomScopeProperties(bid.Catalogs, rand);
            typSS.Devices.Add(valve);

            typical.AddInstance();

            MaterialSummaryVM matVM = new MaterialSummaryVM(bid, cw);

            CostBatch initial = MatVMToCostBatch(matVM);

            //Act
            typSS.Devices.Remove(valve);

            //Assert
            AssertMaterialVMMatchesCostBatch(matVM, initial - valve.CostBatch);
        }
Exemple #2
0
        public void AddValve()
        {
            //Arrange
            TECValve valve = ModelCreation.TestValve(bid.Catalogs, rand);

            valve.AssignRandomScopeProperties(bid.Catalogs, rand);

            TECTypical typical = new TECTypical();

            bid.Systems.Add(typical);

            TECEquipment typEquip = new TECEquipment();

            typical.Equipment.Add(typEquip);

            TECSubScope typSS = new TECSubScope();

            typEquip.SubScope.Add(typSS);

            typical.AddInstance();

            MaterialSummaryVM matVM = new MaterialSummaryVM(bid, cw);

            //Act
            typSS.Devices.Add(valve);

            //Assert
            AssertMaterialVMMatchesCostBatch(matVM, valve.CostBatch);
        }