Beispiel #1
0
        public void AddEnrollmentsValidStudentWithCourses()
        {
            // Arrange:
            dynamic TestObj = new JObject();

            TestObj.Name         = "Óttar Helgi Einarsson";
            TestObj.SSN          = MockFactory.SSN_OTTAR;
            TestObj.DepartmentID = "1";
            TestObj.Courses      = new JArray(
                20437,
                20436,
                20435
                );
            // Act:
            // 4 enrollments exist this student is valid and is enrolling in 3 valid courses
            // enrollment count should increase by 3
            var oldList = _mockFactory.GetMockData <Enrollment>().Count;

            _service.AddEnrollment(TestObj);

            var newList = _mockFactory.GetMockData <Enrollment>().Count;

            // Assert:
            Assert.AreEqual(oldList, newList - 3);
        }