Пример #1
0
        public void GetDisciplines()
        {
            var ids           = this.DataPreparer.CreateDisciplinesSet2().Take(2);
            var expectedItems = this.DataPreparer.GetDisciplines();

            // Tests GetDisciplines(IEnumerable<int> ids)
            AdvAssert.AreEqual(expectedItems.Take(2).ToList(), this.DisciplineStorage.GetDisciplines(ids));

            // Tests GetDisciplines()
            AdvAssert.AreEqual(expectedItems, this.DisciplineStorage.GetDisciplines());

            // Tests GetDisciplines(Func<Discipline, bool>)
            AdvAssert.AreEqual(
                expectedItems.Where(item => item.Owner == Users.Panza).ToList(),
                this.DisciplineStorage.GetDisciplines(item => item.Owner == Users.Panza));

            // Tests GetDisciplinesByGroupId(groupId)
            var groupId = this.UserService.GetGroup(1).Id;

            AdvAssert.AreEqual(
                new[] { expectedItems[0], expectedItems[2] }, this.DisciplineStorage.GetDisciplinesByGroupId(groupId));

            // Tests GetDisciplines(User owner)
            this.tests.SetCurrentUser(Users.Ozo);
            Func <Discipline> expectedItemF =
                () => new Discipline {
                Name = "Discipline5", Owner = Users.Ozo, IsValid = true
            };

            this.DisciplineStorage.AddDiscipline(expectedItemF());
            var currentUser = this.UserService.GetCurrentUser();
            var actualItems = this.DisciplineStorage.GetDisciplines(currentUser);

            AdvAssert.AreEqual(new[] { expectedItemF() }, actualItems);
        }
Пример #2
0
        public void AddCurriculum()
        {
            List <Curriculum> curriculums = CreateDefaultData();
            var ids = curriculums.Select(item => _Storage.AddCurriculum(item)).ToList();

            curriculums.Select((item, index) => index).ToList()
            .ForEach(index => AdvAssert.AreEqual(curriculums[index], _Storage.GetCurriculum(ids[index])));
            try
            {
                _Storage.AddCurriculum(new Curriculum());
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
            try
            {
                _Storage.AddCurriculum(new Curriculum {
                });
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }
Пример #3
0
        public void CreateDisciplineTest()
        {
            var expectedItems = this.DataPreparer.GetDisciplines();
            var controller    = this.GetController <DisciplineController>();

            // add disciplines
            expectedItems.ForEach(item => controller.Create(item));

            // then add "special" discipline
            controller.Create(new Discipline {
                IsValid = false, Owner = "ozo", IsDeleted = true
            });

            expectedItems = this.DataPreparer.GetDisciplines();
            var allItems = this.DisciplineStorage.GetDisciplines()
                           .OrderBy(item => item.Id)
                           .ToList();
            var actualItems = allItems
                              .Take(expectedItems.Count).ToList();
            var actualItem = allItems.Last();

            AdvAssert.AreEqual(expectedItems, actualItems);
            Assert.AreEqual(this.UserService.GetCurrentUser().Username, actualItem.Owner);
            Assert.AreEqual(false, actualItem.IsDeleted);
            Assert.AreEqual(true, actualItem.IsValid);
        }
Пример #4
0
        public void AddStage()
        {
            var curriculums = CreateDefaultData();
            var stages      = curriculums.Select(item => new Stage {
                Name = "Stage", Curriculum = item
            }).ToList();
            var ids = stages.Select(item => _Storage.AddStage(item)).ToList();

            ids.Select((item, i) => i).ToList().ForEach(item => AdvAssert.AreEqual(stages[item], _Storage.GetStage(ids[item])));
            try
            {
                _Storage.AddStage(null);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
            try
            {
                _Storage.AddStage(new Stage {
                });
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }
Пример #5
0
        public void GetCurriculums()
        {
            User user = new User {
                Id = Guid.NewGuid(), Username = "******"
            };
            List <Curriculum> curriculums = CreateDefaultData();
            var ids = curriculums.Select(item => _Storage.AddCurriculum(item)).ToList();

            _Storage.GetCurriculum(ids[3]).Owner = user.Username;
            //Tests GetCurriculums(IEnumerable<int> ids)
            Assert.AreEqual(curriculums, _Storage.GetCurriculums(ids));
            //Tests GetCurriculums()
            Assert.AreEqual(curriculums, _Storage.GetCurriculums());
            //Tests GetCurriculums(User owner)
            AdvAssert.AreEqual(curriculums[3], _Storage.GetCurriculums(user).First());
            List <int> empty = new List <int>();

            try
            {
                _Storage.GetCurriculums(empty);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }
Пример #6
0
        public void GetDiscipline()
        {
            var ids           = this.DataPreparer.CreateDisciplinesSet1();
            var expectedItems = this.DataPreparer.GetDisciplines();

            expectedItems.Select((item, i) => i).ToList()
            .ForEach(i => AdvAssert.AreEqual(expectedItems[i], this.DisciplineStorage.GetDiscipline(ids[i])));
        }
Пример #7
0
        public void ShareDisciplineTest()
        {
            var ids        = this.DataPreparer.CreateDisciplinesSet1();
            var controller = GetController <DisciplineController>();

            // gets data before sharing
            var expectedSharedUsers    = new List <User>();
            var expectedNotSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };
            var actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            var actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);

            // checks if data before sharing was generated correctly
            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);

            // after sharing
            expectedSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };
            expectedNotSharedUsers = new List <User>();

            // share
            var result = controller.Share(ids[0], expectedSharedUsers.Select(u => u.Id).ToList());

            // checks if success sharing
            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = true"));

            // gets currect data
            actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);

            // checks if same as expected
            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);

            // after unsharing
            expectedSharedUsers    = new List <User>();
            expectedNotSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };

            // unshare
            result = controller.Share(ids[0], null);

            // checks if succes unsharing
            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = true"));

            // gets current data
            actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);

            // checks if same as expected
            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);
        }
Пример #8
0
        public void GetTopics()
        {
            var topicIds            = this.DataPreparer.CreateDisciplinesSet4().Take(2).ToList();
            var expectedItems       = this.DataPreparer.GetTopics();
            var topicsPerDiscipline = expectedItems.Count / 3;

            // Tests GetTopics(IEnumerable<int> ids)
            AdvAssert.AreEqual(expectedItems.Take(2).ToList(), this.DisciplineStorage.GetTopics(topicIds));

            // Tests GetTopics(Func<Discipline, bool>)
            AdvAssert.AreEqual(
                expectedItems.Where(item => item.Name == expectedItems[0].Name).ToList(),
                this.DisciplineStorage.GetTopics(item => item.Name == expectedItems[0].Name));

            // Tests GetTopicsByCourseId()
            var courseId = this.CourseService.GetCourse(2).Id;

            AdvAssert.AreEqual(
                expectedItems.Where(item => item.TestCourseRef == courseId || item.TheoryCourseRef == courseId).ToList(),
                this.DisciplineStorage.GetTopicsByCourseId(courseId));

            // Tests GetTopicsByDisciplineId()
            // 1/3 of added topics belongs to first discipline and first stage
            var disciplineId = this.DisciplineStorage.GetDisciplines().First().Id;
            var items        = expectedItems.OrderBy(item => item.ChapterRef).Take(topicsPerDiscipline).ToList();

            AdvAssert.AreEqual(items, this.DisciplineStorage.GetTopicsByDisciplineId(disciplineId));

            // Tests GetTopicsByDisciplineId()
            // first and third discipline connected to group1
            var groupId = this.UserService.GetGroup(1).Id;

            items = expectedItems.OrderBy(item => item.ChapterRef).ToList();
            items = items.Take(topicsPerDiscipline).Union(items.Skip(2 * topicsPerDiscipline).Take(topicsPerDiscipline)).ToList();
            AdvAssert.AreEqual(items, this.DisciplineStorage.GetTopicsByGroupId(groupId));

            // Tests GetTopicsOwnedByUser()
            // add discipline owned by another guy.
            var user = this.UserService.GetCurrentUser();

            this.tests.SetCurrentUser(Users.Ozo);
            disciplineId = this.DisciplineStorage.AddDiscipline(new Discipline {
                Name = "Discipline5", Owner = Users.Ozo
            });
            var chapterId = this.DisciplineStorage.AddChapter(new Chapter {
                Name = "Chapter", DisciplineRef = disciplineId
            });

            this.DisciplineStorage.AddTopic(new Topic {
                Name = "Topic", ChapterRef = chapterId
            });

            items = expectedItems.OrderBy(item => item.ChapterRef).ToList();
            AdvAssert.AreEqual(items, this.DisciplineStorage.GetTopicsOwnedByUser(user));
        }
Пример #9
0
        public void GetChapters()
        {
            var chapterIds    = this.DataPreparer.CreateDisciplinesSet3().Take(2).ToList();
            var expectedItems = this.DataPreparer.GetChapters();

            // Tests GetChapters(IEnumerable<int> ids)
            AdvAssert.AreEqual(expectedItems.Take(2).ToList(), this.DisciplineStorage.GetChapters(chapterIds));

            // Tests GetChapters(Func<Chapter, bool>)
            AdvAssert.AreEqual(
                expectedItems.Where(item => item.Name == expectedItems[0].Name).ToList(),
                this.DisciplineStorage.GetChapters(item => item.Name == expectedItems[0].Name));
        }
Пример #10
0
        public void GetCurriculum()
        {
            var ids         = this.DataPreparer.CreateDisciplinesSet2();
            var curriculums = this.DataPreparer.GetCurriculums();

            AdvAssert.AreEqual(curriculums[0], this.CurriculumStorage.GetCurriculum(ids[0]));
            AdvAssert.AreEqual(curriculums, this.CurriculumStorage.GetCurriculums(ids));

            this.tests.SetCurrentUser(Users.Panza);
            var user = this.UserService.GetCurrentUser();

            AdvAssert.AreEqual(curriculums, this.CurriculumStorage.GetCurriculums(user));
        }
Пример #11
0
        public void AddTopic()
        {
            this.DataPreparer.CreateDisciplinesSet3();
            var expectedItems = this.DataPreparer.GetTopics();

            expectedItems[0].IsDeleted = true; // for test
            var controller = this.GetController <TopicController>();

            expectedItems.ForEach(item => controller.Create(item.ToCreateModel()));

            expectedItems = this.DataPreparer.GetTopics();
            var actualItems = this.DataPreparer.ChapterIds.SelectMany(id => this.DisciplineStorage.GetTopics(item => item.ChapterRef == id))
                              .OrderBy(item => item.Id)
                              .ToList();

            AdvAssert.AreEqual(expectedItems, actualItems);
            Assert.AreNotEqual(expectedItems.Last().SortOrder, actualItems.Last().SortOrder);

            // check authomatically added curriculum chapter topics
            actualItems.ForEach(
                item =>
                Assert.AreEqual(1, this.CurriculumStorage.GetCurriculumChapterTopics(c => c.TopicRef == item.Id).Count));

            var chapterId = this.DataPreparer.ChapterIds[0];

            // add bad topic
            controller = this.GetController <TopicController>();
            var badTopic = new Topic
            {
                TestCourseRef      = null,
                TestTopicTypeRef   = null,
                TheoryCourseRef    = null,
                TheoryTopicTypeRef = null,
                Name       = "BadTopic",
                ChapterRef = chapterId,
            };

            controller.Create(badTopic.ToCreateModel());
            Assert.AreEqual(false, controller.ModelState.IsValid);
            Assert.AreEqual(expectedItems.Count, this.DataPreparer.ChapterIds.Sum(id => this.DisciplineStorage.GetTopics(item => item.ChapterRef == id).Count));

            // add bad topic
            controller    = this.GetController <TopicController>();
            badTopic      = this.DataPreparer.GetTopics()[0];
            badTopic.Name = Enumerable.Repeat('A', 60).ToString();
            controller.Create(badTopic.ToCreateModel());
            Assert.AreEqual(false, controller.ModelState.IsValid);
            Assert.AreEqual(expectedItems.Count, this.DataPreparer.ChapterIds.Sum(id => this.DisciplineStorage.GetTopics(item => item.ChapterRef == id).Count));
        }
Пример #12
0
        public void AddChapter()
        {
            this.DataPreparer.CreateDisciplinesSet2();
            var expectedItems = this.DataPreparer.GetChapters();
            var controller    = this.GetController <ChapterController>();

            expectedItems.ForEach(item => controller.Create(item, item.DisciplineRef));

            expectedItems = this.DataPreparer.GetChapters();
            var actualItems = this.DataPreparer.DisciplineIds.SelectMany(id => this.DisciplineStorage.GetChapters(item => item.DisciplineRef == id))
                              .OrderBy(item => item.Id)
                              .ToList();

            AdvAssert.AreEqual(expectedItems, actualItems);

            // check authomatically added curriculum chapters
            actualItems.ForEach(
                item =>
                Assert.AreEqual(1, this.CurriculumStorage.GetCurriculumChapters(c => c.ChapterRef == item.Id).Count));
        }
Пример #13
0
        public void ShareDiscipline()
        {
            var ids        = this.DataPreparer.CreateDisciplinesSet1();
            var controller = GetController <DisciplineController>();
            // before sharing
            var expectedSharedUsers    = new List <User>();
            var expectedNotSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };
            var actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            var actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);

            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);

            // after sharing
            expectedSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };
            expectedNotSharedUsers = new List <User>();
            var result = controller.Share(ids[0], expectedSharedUsers.Select(u => u.Id).ToList());

            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = true"));
            actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);
            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);

            // after unsharing
            expectedSharedUsers    = new List <User>();
            expectedNotSharedUsers = new List <User> {
                this.GetUser(Users.Ozo)
            };
            result = controller.Share(ids[0], null);
            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = true"));
            actualSharedUsers    = this.DisciplineStorage.GetDisciplineSharedUsers(ids[0]);
            actualNotSharedUsers = this.DisciplineStorage.GetDisciplineNotSharedUsers(ids[0]);
            AdvAssert.AreEqual(expectedSharedUsers, actualSharedUsers);
            AdvAssert.AreEqual(expectedNotSharedUsers, actualNotSharedUsers);
        }
Пример #14
0
        public void GetCurriculum()
        {
            List <Curriculum> curriculums = CreateDefaultData();
            var ids = curriculums.Select(item => _Storage.AddCurriculum(item)).ToList();

            curriculums.Select((item, i) => i).ToList()
            .ForEach(i => AdvAssert.AreEqual(curriculums[i], _Storage.GetCurriculum(ids[i])));
            #region WhyDoesItWorks
            Curriculum cur = _Storage.GetCurriculum(0);
            Assert.AreEqual(null, cur);
            Curriculum curriculumWithExistesId = new Curriculum {
                Name = "ExistedCurriculum", Id = ids[0]
            };
            _Storage.AddCurriculum(curriculumWithExistesId);
            _Storage.GetCurriculum(ids[0]);
            #endregion
            try
            {
                _Storage.GetCurriculum(0);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
            try
            {
                curriculumWithExistesId = new Curriculum {
                    Name = "ExistedCurriculum", Id = ids[0]
                };
                _Storage.AddCurriculum(curriculumWithExistesId);
                _Storage.GetCurriculum(ids[0]);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }
Пример #15
0
        public void UpdateCurriculum()
        {
            Curriculum curriculum = new Curriculum {
                Id = 1, Name = "Curriculum1"
            };

            _Storage.AddCurriculum(curriculum);
            curriculum.Name = "UpdatedCurriculum";
            _Storage.UpdateCurriculum(curriculum);
            var actualCurriculum = _Storage.GetCurriculum(curriculum.Id);

            AdvAssert.AreEqual(curriculum, actualCurriculum);
            try
            {
                _Storage.UpdateCurriculum(null);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.True(true);
            }
        }
Пример #16
0
        public void Update()
        {
            this.DataPreparer.CreateDisciplinesSet4();
            var curriculumController             = this.GetController <CurriculumController>();
            var curriculumChapterController      = this.GetController <CurriculumChapterController>();
            var curriculumChapterTopicController = this.GetController <CurriculumChapterTopicController>();
            var id       = this.DataPreparer.CurriculumIds[0];
            var expected = this.DataPreparer.GetCurriculums()[0];

            expected.StartDate = DateTime.Now;
            expected.EndDate   = DateTime.Now.AddDays(1);
            curriculumController.Edit(id, expected.ToCreateModel());
            AdvAssert.AreEqual(expected, this.CurriculumStorage.GetCurriculum(id));

            // Tests invalidation of curriculum because of it's curriculum chapter dates
            var curriculumChapter = this.CurriculumStorage.GetCurriculumChapters(item => item.CurriculumRef == id).First();

            curriculumChapter.StartDate = DateTime.Now;
            curriculumChapter.EndDate   = DateTime.Now.AddDays(2);
            curriculumChapterController.Edit(curriculumChapter.Id, curriculumChapter.ToCreateModel());
            curriculumChapter = this.CurriculumStorage.GetCurriculumChapters(item => item.CurriculumRef == id).First();
            Assert.AreEqual(curriculumChapter, this.CurriculumStorage.GetCurriculumChapter(curriculumChapter.Id));
            Assert.IsFalse(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests if curriculum becomes valid if curriculum chapter becomes correct
            curriculumChapter.EndDate = DateTime.Now.AddHours(1);
            curriculumChapterController.Edit(curriculumChapter.Id, curriculumChapter.ToCreateModel());
            curriculumChapter = this.CurriculumStorage.GetCurriculumChapters(item => item.CurriculumRef == id).First();
            Assert.AreEqual(curriculumChapter, this.CurriculumStorage.GetCurriculumChapter(curriculumChapter.Id));
            Assert.IsTrue(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests invalidation of curriculum because of it's curriculum chapter topic dates
            var curriculumChapterTopic = this.CurriculumStorage.GetCurriculumChapterTopics(item => item.CurriculumChapterRef == curriculumChapter.Id).First();

            curriculumChapterTopic.TestStartDate = DateTime.Now;
            curriculumChapterTopic.TestEndDate   = DateTime.Now.AddDays(2);
            curriculumChapterTopicController.Edit(curriculumChapterTopic.Id, curriculumChapterTopic.ToCreateModel());
            curriculumChapterTopic = this.CurriculumStorage.GetCurriculumChapterTopics(item => item.CurriculumChapterRef == curriculumChapter.Id).First();
            Assert.AreEqual(curriculumChapterTopic, this.CurriculumStorage.GetCurriculumChapterTopic(curriculumChapterTopic.Id));
            Assert.IsFalse(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests if curriculum becomes valid if curriculum chapter topic becomes correct
            curriculumChapterTopic.TestStartDate = DateTime.Now;
            curriculumChapterTopic.TestEndDate   = DateTime.Now.AddMinutes(20);
            var result = curriculumController.EditTopic(curriculumChapterTopic.Id, curriculumChapterTopic.ToCreateModel());

            curriculumChapterTopic = this.CurriculumStorage.GetCurriculumChapterTopics(item => item.CurriculumChapterRef == curriculumChapter.Id).First();
            Assert.AreEqual(curriculumChapterTopic, this.CurriculumStorage.GetCurriculumChapterTopic(curriculumChapterTopic.Id));
            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = true"));
            Assert.IsTrue(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests invalidation of curriculum because of it's curriculum chapter topic dates are out of curriculums
            curriculumChapter.EndDate   = null;
            curriculumChapter.StartDate = null;
            curriculumChapterController.Edit(curriculumChapter.Id, curriculumChapter.ToCreateModel());
            curriculumChapterTopic.TestStartDate = DateTime.Now;
            curriculumChapterTopic.TestEndDate   = DateTime.Now.AddDays(2);
            curriculumChapterTopicController.Edit(curriculumChapterTopic.Id, curriculumChapterTopic.ToCreateModel());
            Assert.IsFalse(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests invalidation of curriculum which group is deleted
            expected.UserGroupRef = this.DataPreparer.GetGroups()[2].Id;
            curriculumController.Edit(id, expected.ToCreateModel());
            Assert.IsFalse(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests invalidation of curriculum which discipline is invalid
            expected.UserGroupRef = this.DataPreparer.GetGroups()[2].Id;
            curriculumController.Edit(id, expected.ToCreateModel());
            this.DisciplineStorage.MakeDisciplinesInvalid(this.CourseService.GetCourse(2).Id);
            Assert.IsFalse(this.CurriculumStorage.GetCurriculum(id).IsValid);

            // Tests bad data updates
            expected.EndDate = new DateTime(2400, 1, 1);
            curriculumController.Edit(id, expected.ToCreateModel());
            Assert.IsFalse(curriculumController.ModelState.IsValid);

            curriculumChapter           = this.CurriculumStorage.GetCurriculumChapters(item => item.CurriculumRef == id).First();
            curriculumChapter.StartDate = new DateTime(2400, 1, 1);
            curriculumChapter.EndDate   = new DateTime(2400, 1, 1);
            curriculumChapterController.Edit(curriculumChapter.Id, curriculumChapter.ToCreateModel());
            Assert.IsFalse(curriculumChapterController.ModelState.IsValid);

            curriculumChapterTopic.TestEndDate = new DateTime(2400, 1, 1);
            curriculumChapterTopicController.Edit(curriculumChapterTopic.Id, curriculumChapterTopic.ToCreateModel());
            Assert.IsFalse(curriculumChapterTopicController.ModelState.IsValid);

            curriculumChapterTopic.TestEndDate = new DateTime(2400, 1, 1);
            result = curriculumController.EditTopic(curriculumChapterTopic.Id, curriculumChapterTopic.ToCreateModel());
            Assert.IsTrue(result.Data.ToString().ToLower().Contains("success = false"));
        }