public void SaveMarketWordingsForTeamOffice() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateMarketWording(new MarketWording { WordingRefNumber = "MTEST04", Title = "MTEST04" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempMarketWording = rep.Query<MarketWording>(mw => mw.Title == "MTEST04").First(); var marketWordingSettingDto = new MarketWordingSettingDto { Id = tempMarketWording.Id, DisplayOrder = 1, WordingRefNumber = "MTEST04", Title = "MTEST04" }; var teamMarketWordingsDto = new TeamMarketWordingsDto { TeamId = rep.Query<Team>(t => t.Title == "TestTeam").First().Id, OfficeId = "LON", MarketWordingSettingDtoList = new List<MarketWordingSettingDto> { marketWordingSettingDto } }; adminModuleManager.SaveMarketWordingsForTeamOffice(teamMarketWordingsDto); } using (IConsoleRepository rep = new ConsoleRepository()) { var team = rep.Query<Team>(t => t.Title == "TestTeam", t => t.TeamOfficeSettings.Select(tos => tos.MarketWordingSettings.Select(mw => mw.MarketWording))).First(); Assert.AreEqual("MTEST04", team.TeamOfficeSettings.First().MarketWordingSettings.First().MarketWording.Title); _totalMarketWording = _totalMarketWording + 1; } }
public void AddMarketWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateMarketWording(new MarketWording { WordingRefNumber = "MTEST01", Title = "MTEST01" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalMarketWording = rep.Query<MarketWording>(mw => true).Count(); Assert.AreEqual(_totalMarketWording + 1, tempTotalMarketWording); _totalMarketWording = tempTotalMarketWording; } }
public void DeleteMarketWording() { using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); adminModuleManager.CreateMarketWording(new MarketWording { WordingRefNumber = "MTEST03", Title = "MTEST03" }); } using (IConsoleRepository rep = new ConsoleRepository()) { var adminModuleManager = new AdminModuleManager(rep, new LogHandler(), _httpContext.Object, new WebSiteModuleManager(rep, _httpContext.Object)); var tempMarketWording = rep.Query<MarketWording>(mw => mw.Title == "MTEST03").First(); adminModuleManager.DeleteMarketWording(tempMarketWording); } using (IConsoleRepository rep = new ConsoleRepository()) { var tempTotalMarketWording = rep.Query<MarketWording>(mw => true).Count(); var tempMarketWording = rep.Query<MarketWording>(mw => mw.Title == "MTEST03").FirstOrDefault(); Assert.AreEqual(_totalMarketWording, tempTotalMarketWording); Assert.IsNull(tempMarketWording); } }