private void UpdateEvent() { if (string.IsNullOrWhiteSpace(EventTemplate.Name) || string.IsNullOrWhiteSpace(EventTemplate.Description) || string.IsNullOrWhiteSpace(EventTemplate.Place)) { return; } EventTemplate.DateTime = new DateTime(Date.Year, Date.Month, Date.Day, Time.Hours, Time.Minutes, Time.Seconds); EventCatalogSingleton.Update(SelectedEventIndex, EventTemplate); CleanTemplate(); SortEvents(); }
public void EditTestMethod() { EventCatalogSingleton eventCatalogSingleton = EventCatalogSingleton.Instance; eventCatalogSingleton.Events = new ObservableCollection <Event>(); eventCatalogSingleton.Add(new Event() { Id = 0 }); Assert.AreEqual(1, eventCatalogSingleton.Events.Count); Assert.AreEqual(0, eventCatalogSingleton.Events[0].Id); eventCatalogSingleton.Update(0, new Event() { Id = 1 }); Assert.AreEqual(1, eventCatalogSingleton.Events[0].Id); }