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);
 }
        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);
        }
        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);
        }