コード例 #1
0
        public void RemoveTest()
        {
            PrerequisitesForCourseService.Remove(Course.Id, Qualification.Id);
            var removed = PrerequisitesForCourseService.GetFromIdPair(Course.Id, Qualification.Id);

            Assert.AreEqual(removed.Id, -1);
        }
コード例 #2
0
 public PrerequisitesForCourseServiceTest()
 {
     TecAppContext = new TecAppContext();
     PrerequisitesForCourseService = new PrerequisitesForCourseService(TecAppContext);
     QualificationsService         = new QualificationsService.QualificationsService(TecAppContext);
     CourseService = new CourseService.CourseService(TecAppContext);
 }
コード例 #3
0
        public void AddTest()
        {
            var random = new Random();

            Qualification          = QualificationsService.GetAllQualifications()[random.Next(10)];
            Course                 = CourseService.GetAllCourses()[random.Next(100)];
            PrerequisitesForCourse = PrerequisitesForCourseService.Add(new PrerequisitesForCourse()
            {
                Qualification   = Qualification,
                QualificationId = Qualification.Id,
                Course          = Course,
                CourseId        = Course.Id
            });
        }
コード例 #4
0
        public void GetTest()
        {
            var added = PrerequisitesForCourseService.GetFromIdPair(Course.Id, Qualification.Id);

            Assert.AreEqual(added.Id, PrerequisitesForCourse.Id);
        }