public void CreateAssessmentForTeam(Team team) { var assessment = this.GetCurrentAssessmentForTeam(team.Id); if (assessment != null && (assessment.Status.Value == "Open" || assessment.Status.Value == "Moderating")) { throw new ApplicationException("You cannot a new assessment until you complete the previous one."); } assessment = new Data.Assessment(); assessment.TeamId = team.Id; assessment.DateCreated = DateTime.Now; this.Create(assessment); }
private Continuum.Core.Models.AssessmentItem CreateOpenAssessment() { Data.Team team; Data.TeamMember teamMember; CreateTeamAndTeamMember(out team, out teamMember); var assessment = new Data.Assessment() { Team = team, Status = new Data.AssessmentStatus() { Value = "Open" }, Id = 1, TeamId = team.Id }; var assessmentItem = new Data.AssessmentItem() { AssessmentId = 1, CapabilityAchieved = false, CapabiltyId = 1, Id = 1, TeamMemberId = teamMember.Id }; assessment.AssessmentItems.Add(assessmentItem); _mockContainer.Assessments.Add(assessment); return(new Core.Models.AssessmentItem() { AssesmentId = assessmentItem.Id, CapabilityAchieved = assessmentItem.CapabilityAchieved, CapabilityId = assessmentItem.CapabiltyId }); }
private Continuum.Core.Models.AssessmentItem CreateOpenAssessment() { Data.Team team; Data.TeamMember teamMember; CreateTeamAndTeamMember(out team, out teamMember); var assessment = new Data.Assessment() { Team = team, Status = new Data.AssessmentStatus(){ Value = "Open"}, Id = 1, TeamId = team.Id }; var assessmentItem = new Data.AssessmentItem() { AssessmentId = 1, CapabilityAchieved = false, CapabiltyId = 1, Id = 1, TeamMemberId = teamMember.Id }; assessment.AssessmentItems.Add(assessmentItem); _mockContainer.Assessments.Add(assessment); return new Core.Models.AssessmentItem() { AssesmentId = assessmentItem.Id, CapabilityAchieved = assessmentItem.CapabilityAchieved, CapabilityId = assessmentItem.CapabiltyId }; }