public static void Simulate() { SimulateRound(ClubStatus.Round); ClubStatus.Round++; if (ClubStatus.Round < 39) { ClubStatus.CurrentDate.AddDays(7); } //ClubStatus.CurrentDate = Convert.ToDateTime(ScheduleRepo.GetDate(ClubStatus.Round)); else { ClubStatus.CurrentDate = ClubStatus.SeasonEnd; } if (ClubStatus.RoundsToJunior == 0) { var country = CountryRepo.GetCountry(ClubStatus.JuniorCountry); Scout.Send(ClubStatus.Junior, country); ClubStatus.RoundsToJunior--; } else if (ClubStatus.RoundsToJunior > 0) { ClubStatus.RoundsToJunior--; } ClubStatus.SerializeSave(); }
public UnitOfWork(DataContext context) { this.DataContext = context; countryRepo = new CountryRepo(context); continentRepo = new ContinentRepo(context); cityRepo = new CityRepo(context); }
public async void GetCountriesByLanguageTest_ReturnListOfCountriesSpeakingCertainLanguage(string inlineLanguage, int expected) { //Arrange IList <CountryModel> countries = GenerateCountries(); var travelAPIContextMock = new Mock <TravelAPIContext>(); travelAPIContextMock.Setup(c => c.Countries).ReturnsDbSet(countries); var logger = Mock.Of <ILogger <CountryRepo> >(); var countriesRepository = new CountryRepo(travelAPIContextMock.Object, logger); //Act var theCountries = await countriesRepository.GetCountriesByLanguage(inlineLanguage); //Assert Assert.Equal(expected, theCountries.Count); }
public async void GetRightHandTrafficTest(bool inlineBool, int expected) { //Arrange IList <CountryModel> countries = GenerateCountries(); var travelAPIContextMock = new Mock <TravelAPIContext>(); travelAPIContextMock.Setup(c => c.Countries).ReturnsDbSet(countries); var logger = Mock.Of <ILogger <CountryRepo> >(); var countriesRepository = new CountryRepo(travelAPIContextMock.Object, logger); //Act var theCountries = await countriesRepository.GetRightHandTraffic(inlineBool); //Assert Assert.Equal(expected, theCountries.Count); }
public async void GetCountryByNameTest(string inlineName, string expected) { //Arrange IList <CountryModel> countries = GenerateCountries(); var travelAPIContextMock = new Mock <TravelAPIContext>(); travelAPIContextMock.Setup(c => c.Countries).ReturnsDbSet(countries); var logger = Mock.Of <ILogger <CountryRepo> >(); var countriesRepository = new CountryRepo(travelAPIContextMock.Object, logger); //Act var theCountry = await countriesRepository.GetCountry(inlineName); //Assert Assert.Equal(expected, theCountry.Name); }
public async void GetCountriesTest_CheckIfReturnedListContains2Objects() { //Arrange IList <CountryModel> countries = GenerateCountries(); var travelAPIContextMock = new Mock <TravelAPIContext>(); travelAPIContextMock.Setup(c => c.Countries).ReturnsDbSet(countries); var logger = Mock.Of <ILogger <CountryRepo> >(); var countriesRepository = new CountryRepo(travelAPIContextMock.Object, logger); //Act var theCountries = await countriesRepository.GetCountries(); //Assert Assert.Equal(3, theCountries.Count); }
public LabelService(CountryRepo countryRepo) { Console.WriteLine("load() in instance: " + this.GetHashCode()); countryNames = countryRepo.LoadCountryNamesAsMap("en"); this.countryRepo = countryRepo; }
public CountryController(IConfiguration configuration) { cntryRepo = new CountryRepo(configuration); _configuration = configuration; auditLogService = new AuditLogService(HttpContext, configuration); }
public CountryController() { _cRepo = new CountryRepo(); }
public StateManager() { _stateRepo = new StateRepo(); _countryRepo = new CountryRepo(); }
public CityManager() { _cityRepo = new CityRepo(); _stateRepo = new StateRepo(); _countryRepo = new CountryRepo(); }
public CountryManager() { _countryRepo = new CountryRepo(); }