コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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]);
        }
コード例 #4
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
            }
        }
コード例 #5
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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]);
        }
コード例 #6
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
            }
        }
コード例 #7
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
            }
        }
コード例 #8
0
ファイル: UnitTest1.cs プロジェクト: OVALchik/MyRepository
        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);
            }
        }