public object GetCountries()
 {
     return(new
     {
         countries = getCountries.Execute()
     });
 }
 public void RequestCountries()
 {
     getCountries.Execute(
         onNext: countries => { view.RenderCountries(countryModelMapper.Transform(countries)); },
         onError: error => view.ShowErrorMessage(error.Message),
         onCompleted: () => { }, parameters: null);
 }
Ejemplo n.º 3
0
        public void WhenGettingCountryListAndRepositoryReturnsNoRecords_ThenReturnsEmptyCollection()
        {
            var countryRepositoryMock = new Mock <ICountryRepository>();

            countryRepositoryMock.Setup(c => c.GetAll()).Returns(new List <Country>());
            var services = new GetCountries(countryRepositoryMock.Object);

            var countries = services.Execute();

            Assert.Empty(countries);
        }
Ejemplo n.º 4
0
        public void WhenGettingCountryList_ThenReturnsCountryNames()
        {
            var countryRepositoryMock = new Mock <ICountryRepository>();

            countryRepositoryMock.Setup(c => c.GetAll()).Returns(new List <Country>()
            {
                new Country()
            });
            var services = new GetCountries(countryRepositoryMock.Object);

            var countries = services.Execute();

            Assert.NotNull(countries);
            Assert.Equal(1, countries.Count);
        }