Esempio n. 1
0
        public void TestThatUpdateToClosedAssessmentThrowsException()
        {
            var team = new Data.Team();

            team.TeamMembers.Add(new Data.TeamMember()
            {
                UserId = TestUser
            });
            _mockContainer.Teams.Add(team);

            _mockContainer.Assessments.Add(new Data.Assessment()
            {
                Id     = 1,
                Status = new Data.AssessmentStatus()
                {
                    Value = "Closed"
                },
                Team = team
            });

            var result = new Continuum.Core.Models.AssessmentResult();

            result.AssessmentId = 1;

            _assessmentController.Put(new List <Continuum.Core.Models.AssessmentResult>()
            {
                result
            });
        }
Esempio n. 2
0
        public void TestThatModeratingWithoutCreatingAssessmentThrowsException()
        {
            Data.Team       team;
            Data.TeamMember teamMember;
            CreateTeamAndTeamMember(out team, out teamMember);

            var result = new Continuum.Core.Models.AssessmentResult();

            _assessmentController.Put(new List <Continuum.Core.Models.AssessmentResult>()
            {
                result
            });
            Assert.Fail();
        }
Esempio n. 3
0
        public void TestThatCreateAssessmentResultIsCreated()
        {
            CreateOpenAssessment();

            _mockContainer.Assessments.First().Status.Value = "Moderating";

            var result = new Continuum.Core.Models.AssessmentResult();

            result.AssessmentId = _mockContainer.Assessments.First().Id;
            result.Rating       = 3;

            _assessmentController.Put(new List <Continuum.Core.Models.AssessmentResult>()
            {
                result
            });

            Assert.IsTrue(_mockContainer.Assessments.First().AssessmentResults.Count == 1);
            Assert.IsTrue(_mockContainer.Assessments.First().AssessmentResults.First().Rating == result.Rating.ToString());
        }
        public void TestThatUpdateToClosedAssessmentThrowsException()
        {
            var team = new Data.Team();
            team.TeamMembers.Add(new Data.TeamMember() { UserId = TestUser });
            _mockContainer.Teams.Add(team);

            _mockContainer.Assessments.Add(new Data.Assessment()
            {
                Id = 1,
                Status = new Data.AssessmentStatus() { Value = "Closed" },
                Team = team
            });

            var result = new Continuum.Core.Models.AssessmentResult();
            result.AssessmentId = 1;

            _assessmentController.Put(new List<Continuum.Core.Models.AssessmentResult>() { result });
        }
        public void TestThatModeratingWithoutCreatingAssessmentThrowsException()
        {
            Data.Team team;
            Data.TeamMember teamMember;
            CreateTeamAndTeamMember(out team, out teamMember);

            var result = new Continuum.Core.Models.AssessmentResult();

            _assessmentController.Put(new List<Continuum.Core.Models.AssessmentResult>() { result });
            Assert.Fail();
        }
        public void TestThatCreateAssessmentResultIsCreated()
        {
            CreateOpenAssessment();

            _mockContainer.Assessments.First().Status.Value = "Moderating";

            var result = new Continuum.Core.Models.AssessmentResult();
            result.AssessmentId = _mockContainer.Assessments.First().Id;
            result.Rating = 3;

            _assessmentController.Put(new List<Continuum.Core.Models.AssessmentResult>() { result });

            Assert.IsTrue(_mockContainer.Assessments.First().AssessmentResults.Count == 1);
            Assert.IsTrue(_mockContainer.Assessments.First().AssessmentResults.First().Rating == result.Rating.ToString());
        }