public void GetProductivity() { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); Assert.AreEqual(70, st.Productivity); }
public void StorageDepartmentRemovePiple() { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); st.RemovePiple(0); Assert.AreEqual(2, st.PipleList.Count); }
public void StorageDepartmentEditPiple() { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); string piple = "Жууновский В.Я."; st.EditPiple(0, piple); Assert.AreEqual(piple, st.PipleList[0]); }
public void StorageDepartmentConstructor_ErrorProductionList() { try { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var unused = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, null); Assert.Fail(); } catch (ArgumentException e) { Assert.AreEqual("Список продукции не должен быть пустым", e.Message); } }
public void StorageDepartmentEditProduction() { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); Production production = new PrimaryProduction(TypeMaterial.Aluminum, TypeProduction.Plate, "Лист AL-4", new Size(50, 70, 5, 3), 1000); st.EditProduction(0, production); Assert.AreEqual(production, st.Productions[0]); }
public void StorageDepartmentConstructor_ErrorPipleList() { try { var machineList = CreateRobotMachine(); var productionListSt = CreatePrimaryProduction(); var unused = new StorageDepartment(machineList, "Заготовительный цех№1", null, new List <Production>(productionListSt)); Assert.Fail(); } catch (ArgumentException e) { Assert.AreEqual("Список рабочих не должен быть пустым", e.Message); } }
public void StorageDepartmentRemovePiple_ERROR() { try { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); st.RemovePiple(66); Assert.Fail(); } catch (Exception e) { Assert.AreEqual("Неверный индекс", e.Message); } }
public void StorageDepartmentEditProduction_ERROR() { try { var machineList = CreateRobotMachine(); var pipleListSt = CreatePipleList(); var productionListSt = CreatePrimaryProduction(); var st = new StorageDepartment(machineList, "Заготовительный цех№1", pipleListSt, new List <Production>(productionListSt)); Production production = new PrimaryProduction(TypeMaterial.Aluminum, TypeProduction.Plate, "Лист AL-4", new Size(50, 70, 5, 3), 1000); st.EditProduction(66, production); Assert.Fail(); } catch (Exception e) { Assert.AreEqual("Неверный индекс", e.Message); } }