Beispiel #1
0
        public void GetStudentResultForAllTopicsInSelectedDisciplineTest()
        {
            TopicInfoModel target = TopicInfoModel.TopicInfoModelTestObject();
            double         expected;
            double         actual;

            foreach (var student in target.GetSelectStudents())
            {
                if (student.Name == "user1")
                {
                    expected = 120;
                    actual   = target.GetStudentResultForAllTopicsInSelectedDiscipline(student);
                    Assert.AreEqual(expected, actual);
                }
                else if (student.Name == "user2")
                {
                    expected = 180;
                    actual   = target.GetStudentResultForAllTopicsInSelectedDiscipline(student);
                    Assert.AreEqual(expected, actual);
                }
                else
                {
                    Assert.Fail();
                }
            }
        }
Beispiel #2
0
        public ActionResult TopicsInfo(Int32 disciplineId)
        {
            var model = new TopicInfoModel((int)HttpContext.Session["SelectedGroupId"], disciplineId, LmsService);

            HttpContext.Session["Attempts"] = model.GetAllAttemts();

            return(View(model));
        }
Beispiel #3
0
        public ActionResult TopicsInfo(int curriculumId)
        {
            var model = new TopicInfoModel((int)HttpContext.Session["SelectedGroupId"], curriculumId, LmsService);

            HttpContext.Session["Attempts"] = model.AllAttempts;

            return(View(model));
        }
Beispiel #4
0
        public void GetAllTopicsInSelectedDisciplineMaxMarkTest()
        {
            TopicInfoModel target = TopicInfoModel.TopicInfoModelTestObject();
            double         expected;

            expected = 200;
            double actual;

            actual = target.GetAllTopicsInSelectedDisciplineMaxMark();
            Assert.AreEqual(expected, actual);
        }
Beispiel #5
0
        public void GetMaxResutForTopicTest()
        {
            TopicInfoModel    target      = TopicInfoModel.TopicInfoModelTestObject();
            Topic             selectTopic = null;
            Nullable <double> expected    = new Nullable <double>();

            expected = 100;
            Nullable <double> actual;

            actual = target.GetMaxResutForTopic(selectTopic);
            Assert.AreEqual(expected, actual);
        }
Beispiel #6
0
        public void EctsTest()
        {
            TopicInfoModel target = TopicInfoModel.TopicInfoModelTestObject();
            double         percent;
            char           expected;
            char           actual;

            percent  = 90;
            expected = 'A';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);

            percent  = 88;
            expected = 'B';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);

            percent  = 73;
            expected = 'C';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);

            percent  = 67;
            expected = 'D';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);

            percent  = 53;
            expected = 'E';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);

            percent  = 44;
            expected = 'F';
            actual   = target.Ects(percent);
            Assert.AreEqual(expected, actual);
        }