public void SaveCurrency_DeleteExistingCurrency_ShouldDeleteSuccessfully(string eventStyleName) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iEventStyleDal = scope.Resolve <IEventStyleDal>(); var eventResult = _iEventStyleDal.GetEventStyleByName(eventStyleName); eventResult = _iEventStyleDal.SaveEventStyle(eventResult, true); Assert.True(eventResult == null); } }
/// <summary> /// Save/ Update EventStyle and return EventStyle object back /// </summary> /// <param name="eventStyleJson">EventStyle Json object to be saved</param> /// <returns>EventStyle Json object</returns> public string SaveEventStyle(string eventStyleJson) { try { var eventStyle = JsonConvert.DeserializeObject <EventStyle>(eventStyleJson); eventStyle = _iEventStyleDal.SaveEventStyle(eventStyle); return(JsonConvert.SerializeObject(eventStyle)); } catch (Exception ex) { log.Error($"Exception in Method SaveEventStyle for Json Data - {eventStyleJson}", ex); throw; } }
public void SaveEventStyle_SaveNewEvent_ShouldSaveSuccessfully(string name, string description) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iEventStyleDal = scope.Resolve <IEventStyleDal>(); var currency = new EventStyle { Name = name, Description = description }; var currencyResult = _iEventStyleDal.SaveEventStyle(currency); Assert.True(currencyResult != null); } }