public void SaveVenue_DeleteExistingVenue_ShouldDeleteSuccessfully(string Name) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iVenueDal = scope.Resolve <IVenueDal>(); var venueResult = _iVenueDal.GetVenueByName(Name); venueResult = _iVenueDal.SaveVenue(venueResult, true); Assert.True(venueResult == null); } }
/// <summary> /// Save/ Update Venue and return venue object back /// </summary> /// <param name="venueJson">Venue Json object to be saved</param> /// <returns>Venue Json object</returns> public string SaveVenue(string venueJson) { try { var venue = JsonConvert.DeserializeObject <Venue>(venueJson); venue = _iVenueDal.SaveVenue(venue); return(JsonConvert.SerializeObject(venue)); } catch (Exception ex) { log.Error($"Exception in Method SaveVenue for Json Data - {venueJson}", ex); throw; } }
public void SaveVenue_SaveNewVenue_ShouldSaveSuccessfully(string name, int venueTypeId, string address1, string address2, int countryid, int cityId) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iVenueDal = scope.Resolve <IVenueDal>(); var venue = new Venue { Name = name, VenueTypeId = venueTypeId, Address1 = address1, Address2 = address2, CountryId = countryid, CityId = cityId }; var venueResult = _iVenueDal.SaveVenue(venue); Assert.True(venueResult != null); } }