Exemple #1
0
        public void GetSubjectByIdTest()
        {
            var expectedSubject = subjectManager.GetSubjects().LastOrDefault();
            var actualSubject   = subjectManager.GetSubjectByID(expectedSubject.Id);

            Assert.IsNotNull(actualSubject, "Subject is null");

            Assert.AreEqual(expectedSubject.Id, actualSubject.Id, "DB return different id");
            Assert.AreEqual(expectedSubject.Name, actualSubject.Name, "DB return different subject name");

            Assert.IsInstanceOfType(actualSubject, typeof(Subject), "Object type is wrong!");
            Assert.IsInstanceOfType(actualSubject.Id, typeof(int), "Id is not int");
            Assert.IsInstanceOfType(actualSubject.Name, typeof(string), "Subject name is not string");
        }