public void ICGroup_10()
        {
            //arrange
            bool expected = true;

            MDirectionOfPreparation dp = new MDirectionOfPreparation("12а12б12", "Нбпр", 1, "ИАСТ");
            bool actual1 = refData.CDirectionOfPreparation.Insert(dp);

            Assert.AreEqual(expected, actual1);
            MTrainingProfile tp      = new MTrainingProfile("Профель", "ПРЕФ", dp.CodeOfDP);
            bool             actual2 = refData.CTrainingProfile.Insert(tp);

            Assert.AreEqual(expected, actual2);
            MTrainingProfile tp1     = new MTrainingProfile("Непрофиль", "НЕПРОФ", dp.CodeOfDP);
            bool             actual3 = refData.CTrainingProfile.Insert(tp1);

            Assert.AreEqual(expected, actual3);

            MGroup gr      = new MGroup("17-ЮФбо-2в", 1, tp.ShortName, 1, 1, 0, 0, "Васкресенье");
            bool   actual4 = refData.CGroup.Insert(gr);

            Assert.AreEqual(expected, actual4);
            //act
            MGroup gr1     = new MGroup("17-ЮФбо-2г", 2, tp1.ShortName, 2, 2, 1, 1, "Суббата");
            bool   actual5 = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual5);
        }
Beispiel #2
0
        public void Task_251_8()
        {
            //arrange
            bool expected = true;

            MDirectionOfPreparation dp = new MDirectionOfPreparation("12а12ж12", "Нжпр", 1);
            bool actual1 = refData.CDirectionOfPreparation.Insert(dp);

            Assert.AreEqual(expected, actual1);
            MTrainingProfile tp      = new MTrainingProfile("Профдль", "ПРОФД", dp.CodeOfDP);
            bool             actual2 = refData.CTrainingProfile.Insert(tp);

            Assert.AreEqual(expected, actual2);
            MTrainingProfile tp1     = new MTrainingProfile("Непрофтль", "НЕПРОФТ", dp.CodeOfDP);
            bool             actual3 = refData.CTrainingProfile.Insert(tp1);

            Assert.AreEqual(expected, actual3);

            MGroup gr = new MGroup("17-ИДбо-2и", 1, tp.ShortName, 1, 1, 0, 1, "Воскресенье");

            refData.CGroup.Insert(gr);
            //act
            MGroup gr1    = new MGroup("17-ИДбо-2к", 2, tp1.ShortName, 2, 2, 1, 1, "Суббота");
            bool   actual = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
        public void Task_250_1_3()
        {
            SetupData();
            //arrange
            MGroup gr     = new MGroup("17-ММбо-2а", 1, "ММЭТ", 1, 1, 0, 0, "Воскресенье");
            bool   result = refData.CGroup.Insert(gr);

            Assert.IsTrue(result);

            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ММЭбо-2б", 2, "ММЭ", 2, 2, 1, 1, "Воскресенье");

            result = refData.CGroup.Insert(gr1);
            Assert.IsTrue(result);

            gr1.Semester = 1;
            bool actual = refData.CGroup.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);

            result = refData.CGroup.Delete(gr);
            Assert.IsTrue(result);

            result = refData.CGroup.Delete(gr1);
            Assert.IsTrue(result);

            DeleteData();
        }
Beispiel #4
0
        public void task_250_1_4_to_7()         // повтор всех атрибутов кроме неизменяемых
        {
            //arrange
            MGroup gr = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg = new CGroup();

            cg.Insert(gr);
            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ИСбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Воскресенье");

            cg.Insert(gr1);
            //gr1.Group = "17-ИДбо-2б";
            gr1.Semester         = 1;
            gr1.Specialty        = "ИСиТ";
            gr1.Shift            = 1;
            gr1.Students         = 1;
            gr1.MaxNumberOfClass = 0;
            gr1.MinNumberOfClass = 0;
            gr1.Weekends         = "Воскресенье";
            bool actual = cg.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #5
0
        public void UCGroup_5()
        {
            MDirectionOfPreparation mDirection = new MDirectionOfPreparation("01.03.04", "Прикладная математика", 4, "ИАСТ");

            Assert.IsTrue(refData.CDirectionOfPreparation.Insert(mDirection), "Не удалось вставить профиль обучения");

            MTrainingProfile mTrainingProfile = new MTrainingProfile("Математическое моделирование в экономике и технике", "ММЭТ", "01.03.04");

            Assert.IsTrue(refData.CTrainingProfile.Insert(mTrainingProfile), "Не удалось вставить профиль обучения");

            mTrainingProfile = new MTrainingProfile("Математические методы в экономике", "ММЭ", "01.03.04");
            Assert.IsTrue(refData.CTrainingProfile.Insert(mTrainingProfile), "Не удалось вставить направление подготовки");
            //arrange
            MGroup gr = new MGroup("17-ММбо-2а", 1, "ММЭТ", 1, 1, 0, 0, "Воскресенье");

            Assert.IsTrue(refData.CGroup.Insert(gr), "Не удалось вставить группу" + gr.Group);

            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ММЭбо-2б", 2, "ММЭ", 2, 2, 1, 1, "Воскресенье");

            Assert.IsTrue(refData.CGroup.Insert(gr1), "Не удалось вставить группу" + gr1.Group);

            gr1.Students = 1;
            bool actual = refData.CGroup.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual, "Ввод корректных данных с дублирующимися студентами не произошел");

            Assert.IsTrue(refData.CGroup.Delete(gr), "Не удалось удалить группу" + gr.Group);
            Assert.IsTrue(refData.CGroup.Delete(gr1), "Не удалось удалить группу" + gr1.Group);

            Assert.IsTrue(refData.CTrainingProfile.Delete(mTrainingProfile), "Не удалось удалить профиль обучения");
            Assert.IsTrue(refData.CDirectionOfPreparation.Delete(mDirection), "Не удалось удалить направление подготовки");
        }
Beispiel #6
0
        public void task_250_1_1()         // Изменение когда все поля отличаются
        {
            //arrange
            MGroup gr = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg = new CGroup();

            cg.Insert(gr);
            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ИСбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Воскресенье");

            cg.Insert(gr1);
            //gr1.Group = "17-ИДбо-2б";
            //gr1.Semester = 3;
            //gr1.Specialty = "ТМ";
            gr1.Shift            = 2;
            gr1.Students         = 3;
            gr1.MaxNumberOfClass = 3;
            gr1.MinNumberOfClass = 4;
            gr1.Weekends         = "Суббота";
            bool actual = cg.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
        public void ICGroup_9()
        {
            //arrange
            bool expected = true;

            MDirectionOfPreparation dp = new MDirectionOfPreparation("12а12з12", "Нзпр", 1, "ИАСТ");
            bool actual1 = refData.CDirectionOfPreparation.Insert(dp);

            Assert.AreEqual(expected, actual1);
            MTrainingProfile tp      = new MTrainingProfile("Профёль", "ПРОФЁ", dp.CodeOfDP);
            bool             actual2 = refData.CTrainingProfile.Insert(tp);

            Assert.AreEqual(expected, actual2);
            MTrainingProfile tp1     = new MTrainingProfile("Непрофмль", "НЕПРОФМ", dp.CodeOfDP);
            bool             actual3 = refData.CTrainingProfile.Insert(tp1);

            Assert.AreEqual(expected, actual3);

            MGroup gr      = new MGroup("17-ИДбо-2л", 1, tp.ShortName, 1, 1, 0, 0, "Воскресенье");
            bool   actual4 = refData.CGroup.Insert(gr);

            Assert.AreEqual(expected, actual4);
            //act
            MGroup gr1    = new MGroup("17-ИДбо-2м", 2, tp1.ShortName, 2, 2, 1, 1, "Воскресенье");
            bool   actual = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #8
0
        private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }

            if (!(groupIdLabel1.Text.Trim().Equals("0") || string.IsNullOrEmpty(groupIdLabel1.Text.Trim())))
            {
                group = (MGroup)DataMaster.GetObjectById(typeof(MGroup), Convert.ToInt32(groupIdLabel1.Text));
            }
            else
            {
                group = new MGroup();
            }

            group.GroupName    = groupNameTextBox.Text;
            group.ModifiedBy   = lbl_UserName.Text;
            group.ModifiedDate = DateTime.Now;

            DataMaster.SaveOrUpdate(group);

            ModuleControlSettings.SaveLog(ListOfAction.Update, groupNameTextBox.Text, ListOfTable.MGroup, lbl_UserName.Text);
            BindData();
        }
Beispiel #9
0
 public void AddGroup(MGroup group)
 {
     _uow.Groups.Create(new Group {
         Name = group.Name
     });
     _uow.Save();
 }
        public void ICGroup_4()
        {
            //arrange
            bool expected = true;

            MDirectionOfPreparation dp = new MDirectionOfPreparation("12а12г12", "Нгпр", 1, "ИАСТ");
            bool actual1 = refData.CDirectionOfPreparation.Insert(dp);

            Assert.AreEqual(expected, actual1);
            MTrainingProfile tp      = new MTrainingProfile("Профаль", "ПРОФА", dp.CodeOfDP);
            bool             actual2 = refData.CTrainingProfile.Insert(tp);

            Assert.AreEqual(expected, actual2);

            MGroup gr      = new MGroup("17-ИДбо-2а", 1, tp.ShortName, 1, 1, 0, 0, "Воскресенье");
            bool   actual4 = refData.CGroup.Insert(gr);

            Assert.AreEqual(expected, actual4);
            //act
            MGroup gr1    = new MGroup("17-ИДбо-2б", 2, tp.ShortName, 2, 2, 1, 1, "Суббота");
            bool   actual = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
        private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }

            if (!(groupIdLabel1.Text.Trim().Equals("0") || string.IsNullOrEmpty(groupIdLabel1.Text.Trim())))
            {
                group = (MGroup)DataMaster.GetObjectByProperty(typeof(MGroup), MGroup.ColumnNames.GroupId, Convert.ToInt32(groupIdLabel1.Text));
            }
            else
            {
                group = new MGroup();
            }

            //group.GroupId = Convert.ToInt32(groupIdLabel1.Text);
            group.GroupName = groupNameTextBox.Text;

            group.ModifiedBy   = lbl_UserName.Text;
            group.ModifiedDate = DateTime.Now;

            DataMaster.SaveOrUpdate(group);

            BindData();
        }
        public void Task_250_1_1()
        {
            SetupData();
            //arrange
            MGroup gr     = new MGroup("17-ММбо-2а", 1, "ММЭТ", 1, 1, 0, 0, "Воскресенье");
            bool   result = refData.CGroup.Insert(gr);

            Assert.IsTrue(result);
            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ММЭбо-2б", 2, "ММЭ", 2, 2, 1, 1, "Воскресенье");

            result = refData.CGroup.Insert(gr1);
            Assert.IsTrue(result);

            gr1.Shift            = 2;
            gr1.Students         = 3;
            gr1.MaxNumberOfClass = 3;
            gr1.MinNumberOfClass = 4;
            gr1.Weekends         = "Суббота";
            bool actual = refData.CGroup.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);

            result = refData.CGroup.Delete(gr);
            Assert.IsTrue(result);

            result = refData.CGroup.Delete(gr1);
            Assert.IsTrue(result);

            DeleteData();
        }
Beispiel #13
0
        public void UCGroup_7()
        {
            MDirectionOfPreparation mDirection = new MDirectionOfPreparation("01.03.04", "Прикладная математика", 4, "ИАСТ");

            Assert.IsTrue(refData.CDirectionOfPreparation.Insert(mDirection), "Не удалось вставить профиль обучения");

            MTrainingProfile mTrainingProfile = new MTrainingProfile("Математическое моделирование в экономике и технике", "ММЭТ", "01.03.04");

            Assert.IsTrue(refData.CTrainingProfile.Insert(mTrainingProfile), "Не удалось вставить профиль обучения");

            mTrainingProfile = new MTrainingProfile("Математические методы в экономике", "ММЭ", "01.03.04");
            Assert.IsTrue(refData.CTrainingProfile.Insert(mTrainingProfile), "Не удалось вставить направление подготовки");
            //arrange
            MGroup gr = new MGroup("17-ММбо-2а", 1, "ММЭТ", 1, 1, 0, 0, "Воскресенье");

            Assert.IsTrue(refData.CGroup.Insert(gr), "Не удалось вставить группу" + gr.Group);
            //act
            gr.Specialty = "Т";
            bool actual = refData.CGroup.Update(gr);

            //assert
            Assert.IsFalse(actual, "Произошло обновление некорректной специальности");

            Assert.IsTrue(refData.CGroup.Delete(gr), "Не удалось удалить группу" + gr.Group);

            Assert.IsTrue(refData.CTrainingProfile.Delete(mTrainingProfile), "Не удалось удалить профиль обучения");
            Assert.IsTrue(refData.CDirectionOfPreparation.Delete(mDirection), "Не удалось удалить направление подготовки");
        }
Beispiel #14
0
        public void UpdateGroupName(MGroup mGroup)
        {
            var _group = this._context.Groups
                         .Where(g => g.ProjectId == mGroup.ProjectId && g.GroupName == mGroup.GroupName)
                         .First <Group>();

            _group.GroupName = mGroup.GroupName;

            _context.Groups.Update(_group);
            _context.SaveChanges();
        }
        public void DCGroup_2()
        {
            //arrange
            MGroup gr       = new MGroup("17-ИСбо-1в", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   expected = false;
            //act
            bool actual = refData.CGroup.Delete(gr);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #16
0
        public void UCGroup_1()
        {
            //arrange
            refData.CCourseSchedule.Clear();
            refData.CAcademicLoad.Clear();
            refData.CGroup.Clear();
            Assert.IsTrue(refData.CGroup.Rows.Count == 0, "Не удалось очистить таблицу группа");
            MGroup gr = new MGroup("17-ММбо-2а", 1, "ММЭТ", 1, 1, 0, 0, "Воскресенье");

            Assert.IsFalse(refData.CGroup.Update(gr), "Произошли изменения сведений в пустой таблице");
        }
Beispiel #17
0
 public void MGroup_7()
 {
     try
     {
         MGroup G = new MGroup("17-ИСбо-2б", 0, "ИАСТ", 0, 0, 0, 0, "Воскресенье");
         Assert.AreEqual(typeof(ushort), G.MaxNumberOfClass.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Beispiel #18
0
 public void MGroup_3()
 {
     try
     {
         MGroup G = new MGroup("17-ИСбо-2б", 0, "ИАСТ", 0, 0, 0, 0, "Воскресенье");
         Assert.AreEqual(typeof(string), G.Specialty.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Beispiel #19
0
 public void Task_245_3()
 {
     try
     {
         MGroup G = new MGroup("", 0, "", 0, 0, 0, 0, "");
         Assert.AreEqual(typeof(string), G.Specialty.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(groupIdLabel1.Text.Trim()))
     {
         if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             group = (MGroup)DataMaster.GetObjectByProperty(typeof(MGroup), MGroup.ColumnNames.GroupId, int.Parse(groupIdLabel1.Text));
             DataMaster.Delete(group);
             BindData();
         }
     }
 }
Beispiel #21
0
 public void Task_245_5()
 {
     try
     {
         MGroup G = new MGroup("17-ИСбо-2б", 0, "ИАСТ", 0, 0, 0, 0, "Воскресенье");
         Assert.AreEqual(typeof(ushort), G.Students.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Beispiel #22
0
 public void Task_245_7()
 {
     try
     {
         MGroup G = new MGroup("", 0, "", 0, 0, 0, 0, "");
         Assert.AreEqual(typeof(ushort), G.MaxNumberOfClass.GetType(), "Ожидался тип поля string");
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
        public void Task_248_2()         //Удаление не существующей строки
        {
            //arrange
            MGroup gr       = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   expected = false;
            //act
            CGroup cg     = new CGroup();
            bool   actual = cg.Delete(gr);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #24
0
        public bool addMGroup(MGroup mg)
        {
            string cmdString = "INSERT TO mgroup VALUES(" +
                               mg.MGroupId + "," +
                               mg.MGroupName + "," +
                               mg.Num + "," + ");";
            SQLiteCommand cmdAddMGroup = new SQLiteCommand(cmdString, conn);

            cmdAddMGroup.ExecuteNonQuery();
            cmdAddMGroup.Dispose();
            return(true);
        }
Beispiel #25
0
        public void Task_251_1()         //пустая таблица
        {
            //arrange
            bool expected = true;
            //act
            MGroup gr     = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg     = new CGroup();
            bool   actual = cg.Insert(gr);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #26
0
        public void Add(MGroup mGroup)
        {
            this._context.Groups.Add(new Group
            {
                GroupId      = new Guid(),
                GroupName    = mGroup.GroupName,
                ModifiedDate = DateTime.Now,
                ProjectId    = mGroup.ProjectId,
                SceneId      = null
            });

            this._context.SaveChanges();
        }
Beispiel #27
0
        public void Task_251_from_3_or_9()         // дублирование всех атрибутов, кроме атрибута "Группа"
        {
            //arrange
            MGroup gr       = new MGroup("17-ИДбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = true;
            //act
            MGroup gr1    = new MGroup("17-ИДбо-2б", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #28
0
        public void Task_251_2()
        {
            //arrange
            MGroup gr = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");

            refData.CGroup.Insert(gr);
            bool expected = false;
            //act
            MGroup gr1    = new MGroup("17-ИСбо-2а", 2, "ИСиТД", 2, 2, 1, 1, "Суббота");
            bool   actual = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #29
0
        public void Task_251_11() //полное дублирование всех атрибутов
        {
            //arrange
            MGroup gr = new MGroup("17-ТМбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");

            refData.CGroup.Insert(gr);
            bool expected = false;
            //act
            MGroup gr1    = new MGroup("17-ТМбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   actual = refData.CGroup.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #30
0
        public void Task_251_10()         //добавление записи ктороая не дублирует ни один атрибут уже имеющейся записи
        {
            //arrange
            MGroup gr       = new MGroup("17-ЮФбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = true;
            //act
            MGroup gr1    = new MGroup("17-ЮФбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Суббота");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }