public void Can_Update_Title() { // Arrange string title = "New Event Series"; string description = "This is a new Event Series"; var es = new EventSeries(title, description); Assert.Equal("New Event Series", es.Title); // Act es.UpdateTitle("Updated Title"); // Assert Assert.Equal("Updated Title", es.Title); }
public bool UpdateEventSeries(int eventSeriesId, string title, string description, out string response) { EventSeries toUpdate = EventSeries.Get(eventSeriesId); if (EventSeries.ValueIsInUseByIdForExpression(x => x.Title == title && x.Id != eventSeriesId)) { response = $"Cannot update Event Series: Title is in use by another Series."; return(false); } try { toUpdate.UpdateTitle(title); toUpdate.UpdateDescription(description); Complete(); response = "Event Series updated."; return(true); } catch (Exception ex) { response = ex.Message; return(false); } }