public void AddEventType_Valid() { setup(); Assert.AreEqual(1, EventTypeAccessor.AddEventType("Test")); TestCleanupAccessor.DeleteEventTypeTest(eventTypeToTest); }
public void UpdateEventType_Valid() { setup(); EventTypeAccessor.AddEventType("Test"); eventTypeToTest = getEventTypeID(list); Assert.AreEqual(1, EventTypeAccessor.UpdateEventType(eventTypeToTest, eventTypeToEdit)); TestCleanupAccessor.DeleteEventTypeTest(eventTypeToEdit); }
/// <summary> /// Matt Lapka /// Created: 2015/02/08 /// Add a single EventType object ///</summary> ///<returns>result of adding the eventtype</returns> public EventResult AddNewEventType(string eventName) { try { if (EventTypeAccessor.AddEventType(eventName) == 1) { //refresh cache DataCache._currentEventTypeList = EventTypeAccessor.GetEventTypeList(); DataCache._EventTypeListTime = DateTime.Now; return(EventResult.Success); } return(EventResult.NotAdded); } catch (ApplicationException ex) { return(ex.Message == "Concurrency Violation" ? EventResult.ChangedByOtherUser : EventResult.DatabaseError); } catch (Exception) { return(EventResult.DatabaseError); } }