Example #1
0
        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();
        }
Example #2
0
 public UnitOfWork(DataContext context)
 {
     this.DataContext = context;
     countryRepo      = new CountryRepo(context);
     continentRepo    = new ContinentRepo(context);
     cityRepo         = new CityRepo(context);
 }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
 }
Example #9
0
 public CountryController()
 {
     _cRepo = new CountryRepo();
 }
Example #10
0
 public StateManager()
 {
     _stateRepo   = new StateRepo();
     _countryRepo = new CountryRepo();
 }
Example #11
0
 public CityManager()
 {
     _cityRepo    = new CityRepo();
     _stateRepo   = new StateRepo();
     _countryRepo = new CountryRepo();
 }
Example #12
0
 public CountryManager()
 {
     _countryRepo = new CountryRepo();
 }