public void SaveCity_SaveNewCity_ShouldSaveSuccessfully(Facility facility) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iFacilityDal = scope.Resolve <IFacilityDal>(); var cityResult = _iFacilityDal.SaveFacility(facility); Assert.True(cityResult != null); } }
/// <summary> /// Save/ Update Facility and return Facility object back /// </summary> /// <param name="facilityJson">Facility Json object to be saved</param> /// <returns>Facility Json object</returns> public string SaveFacility(string facilityJson) { try { var facility = JsonConvert.DeserializeObject <Facility>(facilityJson); facility = _iFacilityDal.SaveFacility(facility); return(JsonConvert.SerializeObject(facility)); } catch (Exception ex) { log.Error($"Exception in Method SaveFacility for Json Data - {facilityJson}", ex); throw; } }