Пример #1
0
        public MAuditor Pre_condition_Update()
        {
            Controllers.CAuditor.Clear();
            MAuditor T_Auditor = new MAuditor("502", "каф. Иностранных языков", 20, 5);

            Controllers.CAuditor.Insert(T_Auditor);
            return(T_Auditor);
        }
Пример #2
0
        public void Task_336_5()
        {
            MAuditor T_Auditor = Pre_condition_Update();

            T_Auditor = new MAuditor("302", "каф. Дизайна", 30, 5);
            bool result = Controllers.CAuditor.Update(T_Auditor);

            Assert.IsFalse(result, "Ожидаем, что Модель не изменяется");
        }
Пример #3
0
 public void MAuditor_1()
 {
     try
     {
         MAuditor T_Auditor = new MAuditor("", "", 0, "");
         Assert.AreEqual(typeof(String), T_Auditor.NameOfAuditor.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Пример #4
0
 public void Task_274_5()
 {
     try
     {
         MAuditor T_Auditor = new MAuditor("", "", 0, 0);
         Assert.AreEqual(typeof(byte), T_Auditor.Building.GetType(), "Ожидался тип поля byte");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Пример #5
0
 public void Task_274_4()
 {
     try
     {
         MAuditor T_Auditor = new MAuditor("", "", 0, 0);
         Assert.AreEqual(typeof(ushort), T_Auditor.Spacious.GetType(), "Ожидался тип поля ushort");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Пример #6
0
 public void MAuditor_4()
 {
     try
     {
         MAuditor T_Auditor = new MAuditor("", "", 0, "");
         Assert.AreEqual(typeof(String), T_Auditor.Building.GetType(), "Ожидался тип поля ushort");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Пример #7
0
 public void Task_274_3()
 {
     try
     {
         MAuditor T_Auditor = new MAuditor("", "", 0, 0);
         Assert.AreEqual(typeof(String), T_Auditor.Cafedra.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
        public void Task_270_1() //пустая таблица
        {
            //arrange
            bool expected = true;
            //act
            MAuditor aud    = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            CAuditor ca     = new CAuditor();
            bool     actual = ca.Insert(aud);

            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #9
0
        public void Task_271_2()
        {
            bool     ex = false;
            bool     act;
            MAuditor T_Auditor = new MAuditor("208", "каф. Иностранных языков", 20, 5);
            int      C1        = Controllers.CAuditor.Rows.Count;

            act = Controllers.CAuditor.Delete(T_Auditor);
            int C2 = Controllers.CAuditor.Rows.Count;

            Assert.AreEqual(ex, act);
            Assert.AreEqual(C1, C2);
        }
Пример #10
0
        public void Task_334_1()
        {
            bool     ex = true;
            bool     act;
            MAuditor T_Auditor = new MAuditor("502", "каф. Иностранных языков", 20, 5);
            int      C1        = Controllers.CAuditor.Rows.Count;

            act = Controllers.CAuditor.Insert(T_Auditor);
            int C2 = Controllers.CAuditor.Rows.Count;

            Assert.AreEqual(ex, act);
            Assert.AreEqual(C1 + 1, C2);
        }
Пример #11
0
        public void Task_271_1()
        {
            Pre_condition_Del();
            bool     ex = true;
            bool     act;
            MAuditor T_Auditor = new MAuditor("208", "каф. Иностранных языков", 20, 5);
            int      C1        = Controllers.CAuditor.Rows.Count;

            act = Controllers.CAuditor.Delete(T_Auditor);
            int C2 = Controllers.CAuditor.Rows.Count;

            Assert.AreEqual(ex, act);
            Assert.AreEqual(C1 - 1, C2);
        }
        public void Task_270_4() // дбавление записи, которая не дублирует ни один атрибут кроме числа мест
        {
            //arrange
            MAuditor aud      = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            CAuditor ca       = new CAuditor();
            bool     a        = ca.Insert(aud);
            bool     expected = true;
            //act
            MAuditor aud1   = new MAuditor("302", "каф. Дизайна", 20, "4");
            bool     actual = ca.Insert(aud1);

            //assert
            Assert.AreEqual(expected, actual);
        }
        public void Task_270_7() //полное дублирование всех атрибутов
        {
            //arrange
            MAuditor aud      = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            CAuditor ca       = new CAuditor();
            bool     a        = ca.Insert(aud);
            bool     expected = false;
            //act
            MAuditor aud1   = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            bool     actual = ca.Insert(aud1);

            //assert
            Assert.AreEqual(expected, actual);
        }
        public void Task_270_6() //добавление записи ктороая не дублирует ни один атрибут уже имеющейся записи
        {
            //arrange
            MAuditor aud      = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            CAuditor ca       = new CAuditor();
            bool     a        = ca.Insert(aud);
            bool     expected = true;
            //act
            MAuditor aud1   = new MAuditor("302", "каф. Дизайна", 30, "4");
            bool     actual = ca.Insert(aud1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #15
0
        public void ICAuditor_5() // дбавление записи, которая не дублирует ни один атрибут кроме названия
        {
            //arrange
            MAuditor aud      = new MAuditor("502", "каф. Иностранных языков", 20, "5");
            CAuditor ca       = new CAuditor();
            bool     a        = ca.Insert(aud);
            bool     expected = false;
            //act
            MAuditor aud1   = new MAuditor("502", "каф. Дизайна", 20, "5");
            bool     actual = ca.Insert(aud1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #16
0
        public void Task_334_2()
        {
            Pre_condition_Insert();
            bool     ex = true;
            bool     act;
            MAuditor T_Auditor = new MAuditor("302", "каф. Дизайна", 30, 5);
            int      C1        = Controllers.CAuditor.Rows.Count;

            act = Controllers.CAuditor.Insert(T_Auditor);
            int C2 = Controllers.CAuditor.Rows.Count;

            Assert.AreEqual(ex, act);
            Assert.AreEqual(C1 + 1, C2);
        }
Пример #17
0
        public void Pre_condition_Insert()
        {
            Controllers.CAuditor.Clear();
            bool     ex = true;
            bool     act;
            MAuditor T_Auditor = new MAuditor("502", "каф. Иностранных языков", 20, 5);
            int      C1        = Controllers.CAuditor.Rows.Count;

            act = Controllers.CAuditor.Insert(T_Auditor);
            int C2 = Controllers.CAuditor.Rows.Count;

            Assert.AreEqual(ex, act);
            Assert.AreEqual(C1 + 1, C2);
        }