Esempio n. 1
0
        public void SetUpDependencies()
        {
            dbManager = Mock.Of <ICountryAggregateManager> ();
            countryNameMappingService = Mock.Of <ICountryNameMappingService>();
            statService = Mock.Of <IStatService>();

            countryService = new CountryService(dbManager, countryNameMappingService, statService);

            Mock.Get(dbManager)
            .Setup(d => d.GetCountriesAndPopulation())
            .Returns(Task.FromResult(CreateDatasetOne()));

            Mock.Get(statService)
            .Setup(s => s.GetCountryPopulationsAsync())
            .Returns(Task.FromResult(CreateDatasetTwo()));

            Mock.Get(countryNameMappingService)
            .Setup(c => c.MapCountryNameToIso3166(It.IsAny <string>()))
            .Returns((string s) => s);
        }
Esempio n. 2
0
 public CountryService(ICountryAggregateManager dbManager, ICountryNameMappingService countryNameMappingService, IStatService statService)
 {
     this.dbManager = dbManager;
     this.countryNameMappingService = countryNameMappingService;
     this.statService = statService;
 }