public void GetCountryById_ExistingId_ShouldReturnValue(int countryId) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iCountryDal = scope.Resolve <ICountryDal>(); var country = _iCountryDal.GetCountryById(countryId); Assert.True(country != null); } }
/// <summary> /// Select Country by Country Id /// </summary> /// <param name="countryId">int object</param> /// <returns>Json object</returns> public string GetCountryById(int countryId) { try { var country = _iCountryDal.GetCountryById(countryId); return(JsonConvert.SerializeObject(country)); } catch (Exception ex) { log.Error($"Exception in Method GetCountryById for id - {countryId}", ex); throw; } }