public async void CountriesService_On_GetHRLangagesByContinentAsync_With_Stub_Langage_Repository_Return_Langage_Without_Alteration() { LanguageRepositoryStub langRepo = new LanguageRepositoryStub(); langRepo.Langs.Add(new Language() { Name = "1" }); langRepo.Langs.Add(new Language() { Name = "2" }); langRepo.Langs.Add(new Language() { Name = "1" }); CoreCountriesService coreService = new CoreCountriesService(null, langRepo, null, null, null, null); Region region = Region.Africa; using (Task <IEnumerable <Language> > task = coreService.GetHRLangagesByContinentAsync(region)) { await task; Assert.NotNull(task.Result); Assert.Equal(3, task.Result.ToList().Count); Assert.Equal("1", task.Result.ToList()[0].Name); Assert.Equal("2", task.Result.ToList()[1].Name); Assert.Equal("1", task.Result.ToList()[2].Name); } }
public async void CountriesService_On_GetHRLangagesByContinentAsync_With_Null_Langage_Repository_Throw_MemberAccessException() { HRCoreCountriesRepositoryStub repository = new HRCoreCountriesRepositoryStub(new List <string>() { "aa" }, "aa"); CoreCountriesService coreService = new CoreCountriesService(repository, null, null, null, null, null); Region region = Region.Africa; await Assert.ThrowsAsync <MemberAccessException>(async() => await coreService.GetHRLangagesByContinentAsync(region)); }