Пример #1
0
        public void EnrollmentInsertDeletePostTest()
        {
            try
            {
                var enrollmentController = new EnrollmentController();

                enrollmentController.DeleteEnrollment("A000005", 105);

                var enrollment = enrollmentController.GetEnrollmentInfo("A000005", 105);
                Assert.AreEqual(null, enrollment);

                enrollmentController.InsertEnrollment(new Enrollment
                {
                    StudentId  = "A000005",
                    ScheduleId = 105,
                    Grade      = "D+"
                });

                enrollment = enrollmentController.GetEnrollmentInfo("A000005", 105);
                Assert.AreEqual("A000005", enrollment[0].StudentId);
                Assert.AreEqual(105, enrollment[0].ScheduleId);
                Assert.AreEqual("D+", enrollment[0].Grade);

                enrollmentController.DeleteEnrollment("A000005", 105);

                enrollment = enrollmentController.GetEnrollmentInfo("A000005", 105);
                Assert.AreEqual(null, enrollment);
            }
            catch
            {
                throw;
            }
        }