private async void EventEditList_TestGetEventEditList()
        {
            var eventEditList = await EventEditList.GetEventEditList();

            Assert.NotNull(eventEditList);
            Assert.True(eventEditList.Count > 0);
        }
Beispiel #2
0
        public async Task EventEdit_TestDeleteEvent()
        {
            const int ID_TO_DELETE = 99;

            var beforeList = await EventEditList.GetEventEditList();

            var beforeCount = beforeList.Count;

            await EventEdit.DeleteEventEdit(ID_TO_DELETE);

            var afterList = await EventEditList.GetEventEditList();

            Assert.NotEqual(beforeCount, afterList.Count);
        }
        private async void EventEditList_TestAddEventsEntry()
        {
            var eventList = await EventEditList.GetEventEditList();

            var countBeforeAdd = eventList.Count;

            var eventToAdd = eventList.AddNew();

            BuildEvent(eventToAdd);

            var updatedEventsList = await eventList.SaveAsync();

            Assert.NotEqual(countBeforeAdd, updatedEventsList.Count);
        }
        private async void EventEditList_TestUpdateEventsEntry()
        {
            const int ID_TO_UPDATE = 1;
            var       eventList    = await EventEditList.GetEventEditList();

            var countBeforeUpdate = eventList.Count;
            var eventToUpdate     = eventList.First(a => a.Id == ID_TO_UPDATE);

            eventToUpdate.Description = "This was updated";
            await eventList.SaveAsync();

            var updatedEventsList = await EventEditList.GetEventEditList();

            Assert.Equal("This was updated", updatedEventsList.First(a => a.Id == ID_TO_UPDATE).Description);
            Assert.Equal(countBeforeUpdate, updatedEventsList.Count);
        }
        private async void EventEditList_TestDeleteEventsEntry()
        {
            const int ID_TO_DELETE = 99;

            var eventEditList = await EventEditList.GetEventEditList();

            var listCount = eventEditList.Count;

            var eventToDelete = eventEditList.First(a => a.Id == ID_TO_DELETE);

            // remove is deferred delete
            eventEditList.Remove(eventToDelete);

            var eventListAfterDelete = await eventEditList.SaveAsync();

            Assert.NotEqual(listCount, eventListAfterDelete.Count);
        }