Exemple #1
0
        public void CanGetMyClassOne()
        {
            ProfessorController prof = new ProfessorController();
            Team55LMSContext    db   = MakeClassForProfessor();

            prof.UseLMSContext(db);

            var     oneClass = prof.GetMyClasses("u0999990") as JsonResult;
            dynamic result   = oneClass.Value;

            Assert.Equal("{ subject = GERM, number = 1010, name = Beginner German I, season = Fall, year = 2018 }", result[0].ToString());
        }
Exemple #2
0
        public void CanGetMyClasses()
        {
            ProfessorController prof = new ProfessorController();
            Team55LMSContext    db   = MakeClassesForProfessor();

            prof.UseLMSContext(db);

            var     profClasses = prof.GetMyClasses("u1111110") as JsonResult;
            dynamic result      = profClasses.Value;

            String firstClass  = "{ subject = CS, number = 1030, name = Intro to Computer Science, season = Fall, year = 2018 }";
            String secondClass = "{ subject = CS, number = 2420, name = Data Structures & Algorithms, season = Fall, year = 2017 }";

            Assert.Equal(firstClass, result[0].ToString());
            Assert.Equal(secondClass, result[1].ToString());
        }