public void DistributeLoadTest()
        {
            var repository    = new Data.Repository(new Data.CathedraDBDataContext());
            var plan          = repository.GetTableLoadInCoursePlan().Where(x => x.SortLoad.Algorithm == 2);
            var planSumHourse = plan.Sum(x => x.CountHours);
            var classTest     = new DistributeLoadIsLab(repository, 0);
            var saveData      = false;

            var result          = classTest.DistributeLoad(plan, saveData);
            var resultSumHourse = result.Sum(x => x.CountHours);

            Assert.AreEqual(resultSumHourse, planSumHourse);
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Действительно распределить нагрузку?", "",
                                         MessageBoxButtons.YesNo,
                                         MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                var labLoad = new DistributeLoadIsLab(_rep, 10);
                labLoad.DistributeLoad();
                MessageBox.Show("Распределение завершенно");
                UpdateDataGridView();
            }
        }