public void DeleteSubjectToClauseWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateSubjectToClauseWording(new SubjectToClauseWording { WordingRefNumber = "STEST03", Title = "STEST03" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempSubjectToClauseWording = rep.Query<SubjectToClauseWording>(sw => sw.Title == "STEST03").First(); adminModuleManager.DeleteSubjectToClauseWording(tempSubjectToClauseWording); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalSubjectToClauseWording = rep.Query<SubjectToClauseWording>(sw => true).Count(); var tempSubjectToClauseWording = rep.Query<SubjectToClauseWording>(sw => sw.Title == "STEST03").FirstOrDefault(); Assert.AreEqual(_totalSubjectToClauseWording, tempTotalSubjectToClauseWording); Assert.IsNull(tempSubjectToClauseWording); } }
public void SaveSubjectToClauseWordingsForTeamOffice() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateSubjectToClauseWording(new SubjectToClauseWording { WordingRefNumber = "STEST04", Title = "STEST04" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempSubjectToClauseWording = rep.Query<SubjectToClauseWording>(sw => sw.Title == "STEST04").First(); var subjectToClauseWordingSettingDto = new SubjectToClauseWordingSettingDto { Id = tempSubjectToClauseWording.Id, DisplayOrder = 1, Title = "STEST04" }; var teamSubjectToClauseWordingsDto = new TeamSubjectToClauseWordingsDto { TeamId = rep.Query<Team>(t => t.Title == "TestTeam").First().Id, OfficeId = "LON", SubjectToClauseWordingSettingDtoList = new List<SubjectToClauseWordingSettingDto> { subjectToClauseWordingSettingDto } }; adminModuleManager.SaveSubjectToClauseWordingsForTeamOffice(teamSubjectToClauseWordingsDto); } using (IConsoleRepository rep = new ConsoleRepository()) { var team = rep.Query<Team>(t => t.Title == "TestTeam", t => t.TeamOfficeSettings.Select(tos => tos.SubjectToClauseWordingSettings.Select(sw => sw.SubjectToClauseWording))).First(); Assert.AreEqual("STEST04", team.TeamOfficeSettings.First().SubjectToClauseWordingSettings.First().SubjectToClauseWording.Title); _totalSubjectToClauseWording = _totalSubjectToClauseWording + 1; } }
public void AddSubjectToClauseWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateSubjectToClauseWording(new SubjectToClauseWording { WordingRefNumber = "STEST01", Title = "STEST01" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalSubjectToClauseWording = rep.Query<SubjectToClauseWording>(sw => true).Count(); Assert.AreEqual(_totalSubjectToClauseWording + 1, tempTotalSubjectToClauseWording); _totalSubjectToClauseWording = tempTotalSubjectToClauseWording; } }