public void DeleteTermsNConditionWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateTermsNConditionWording(new TermsNConditionWording { WordingRefNumber = "TTEST03", Title = "TTEST03" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempTermsNConditionWording = rep.Query<TermsNConditionWording>(tnc => tnc.Title == "TTEST03").First(); adminModuleManager.DeleteTermsNConditionWording(tempTermsNConditionWording); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalTermsNConditionWording = rep.Query<TermsNConditionWording>(tnc => true).Count(); var tempTermsNConditionWording = rep.Query<TermsNConditionWording>(tnc => tnc.Title == "TTEST03").FirstOrDefault(); Assert.AreEqual(_totalTermsNConditionWording, tempTotalTermsNConditionWording); Assert.IsNull(tempTermsNConditionWording); } }
public void SaveTermsNConditionWordingsForTeamOffice() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateTermsNConditionWording(new TermsNConditionWording { WordingRefNumber = "TTEST04", Title = "TTEST04" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempTermsNConditionWording = rep.Query<TermsNConditionWording>(tnc => tnc.Title == "TTEST04").First(); var termsNConditionWordingSettingDto = new TermsNConditionWordingSettingDto { Id = tempTermsNConditionWording.Id, DisplayOrder = 1, WordingRefNumber = "TTEST04", Title = "TTEST04" }; var teamTermsNConditionWordingsDto = new TeamTermsNConditionWordingsDto { TeamId = rep.Query<Team>(t => t.Title == "TestTeam").First().Id, OfficeId = "LON", TermsNConditionWordingSettingDtoList = new List<TermsNConditionWordingSettingDto> { termsNConditionWordingSettingDto } }; adminModuleManager.SaveTermsNConditionWordingsForTeamOffice(teamTermsNConditionWordingsDto); } using (IConsoleRepository rep = new ConsoleRepository()) { var team = rep.Query<Team>(t => t.Title == "TestTeam", t => t.TeamOfficeSettings.Select(tos => tos.TermsNConditionWordingSettings.Select(tnc => tnc.TermsNConditionWording))).First(); Assert.AreEqual("TTEST04", team.TeamOfficeSettings.First().TermsNConditionWordingSettings.First().TermsNConditionWording.Title); _totalTermsNConditionWording = _totalTermsNConditionWording + 1; } }
public void AddTermsNConditionWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateTermsNConditionWording(new TermsNConditionWording { WordingRefNumber = "TTEST01", Title = "TTEST01" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalTermsNConditionWording = rep.Query<TermsNConditionWording>(tnc => true).Count(); Assert.AreEqual(_totalTermsNConditionWording + 1, tempTotalTermsNConditionWording); _totalTermsNConditionWording = tempTotalTermsNConditionWording; } }