Exemple #1
0
 public new void SetUp()
 {
     Seed(Context);
     m_analyzer = new TeacherStatisticsAnalyzer(Context);
 }
Exemple #2
0
        public void SetUp()
        {
            var ratingManagerMock = new Mock <IRatingsManager>();

            List <Rating> testRatingList = new List <Rating>();

            m_teacherSingleRating = new Teacher()
            {
                Id          = Guid.NewGuid(),
                FirstName   = "Vardenis",
                LastName    = "Pavardenis",
                Description = "desc",
                Rank        = "Professor",
                Faculty     = "MIF"
            };

            m_teacherMultipleRatings = new Teacher()
            {
                Id          = Guid.NewGuid(),
                FirstName   = "Vardenis",
                LastName    = "Pavardenis",
                Description = "desc",
                Rank        = "Professor",
                Faculty     = "MIF"
            };

            var student = new Student
            {
                Id          = Guid.NewGuid(),
                FirstName   = "Studentas",
                LastName    = "Studentelis",
                Studies     = "Programu sistemos",
                Faculty     = "MIF",
                Description = "desc"
            };

            var course = new Course
            {
                Id         = Guid.NewGuid(),
                Name       = "Taikomasis objektinis programavimas",
                CourseType = CourseType.Compulsory,
                Credits    = 5,
                Faculty    = "MIF"
            };

            var rating_SingleRating = new Rating()
            {
                Id                    = Guid.NewGuid(),
                TeacherId             = m_teacherSingleRating.Id,
                CourseId              = course.Id,
                OverallMark           = 4,
                LevelOfDifficulty     = 2,
                WouldTakeTeacherAgain = true,
                Tags                  = new List <RatingTag>(),
                DateCreated           = new DateTime(2010, 01, 02),
                Comment               = "Cool guy"
            };

            var rating1_MultipleRatings = new Rating()
            {
                Id                    = Guid.NewGuid(),
                TeacherId             = m_teacherMultipleRatings.Id,
                CourseId              = course.Id,
                OverallMark           = 10,
                LevelOfDifficulty     = 2,
                WouldTakeTeacherAgain = true,
                Tags                  = new List <RatingTag>(),
                DateCreated           = new DateTime(2019, 01, 02),
                Comment               = "Cool guy"
            };

            var rating2_MultipleRatings = new Rating()
            {
                Id                    = Guid.NewGuid(),
                TeacherId             = m_teacherMultipleRatings.Id,
                CourseId              = course.Id,
                OverallMark           = 9,
                LevelOfDifficulty     = 10,
                WouldTakeTeacherAgain = true,
                Tags                  = new List <RatingTag>(),
                DateCreated           = new DateTime(2019, 03, 21),
                Comment               = "Cool guy"
            };

            var rating3_MultipleRatings = new Rating()
            {
                Id                    = Guid.NewGuid(),
                TeacherId             = m_teacherMultipleRatings.Id,
                CourseId              = course.Id,
                OverallMark           = 2,
                LevelOfDifficulty     = 6,
                WouldTakeTeacherAgain = false,
                Tags                  = new List <RatingTag>(),
                DateCreated           = new DateTime(2019, 02, 11),
                Comment               = "Cool guy"
            };

            var rating4_MultipleRatings = new Rating()
            {
                Id                    = Guid.NewGuid(),
                TeacherId             = m_teacherMultipleRatings.Id,
                CourseId              = course.Id,
                OverallMark           = 4,
                LevelOfDifficulty     = 8,
                WouldTakeTeacherAgain = true,
                Tags                  = new List <RatingTag>(),
                DateCreated           = new DateTime(2019, 01, 01),
                Comment               = "Cool guy"
            };


            testRatingList.AddRange(new List <Rating>()
            {
                rating_SingleRating, rating1_MultipleRatings, rating2_MultipleRatings, rating3_MultipleRatings, rating4_MultipleRatings
            });

            ratingManagerMock
            .Setup(x => x.GetAll())
            .ReturnsAsync(testRatingList);

            m_clientMock = new Mock <IRateMyPClient>();
            m_clientMock.Setup(x => x.Ratings).Returns(ratingManagerMock.Object);

            m_analyzer = new TeacherStatisticsAnalyzer(m_clientMock.Object);
        }