Exemplo n.º 1
0
        public void GetCityById_NonExistingValue_ShouldNotReturnValue(int cityId)
        {
            using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString()))
            {
                _iCityDal = scope.Resolve <ICityDal>();

                var cityList = _iCityDal.GetCityById(cityId);

                Assert.True(cityList == null);
            }
        }
Exemplo n.º 2
0
 public string GetCityById(int cityId)
 {
     try
     {
         var city = _iCityDal.GetCityById(cityId);
         return(JsonConvert.SerializeObject(city));
     }
     catch (Exception ex)
     {
         log.Error($"Exception in Method GetCityById for id - {cityId}", ex);
         throw;
     }
 }