コード例 #1
0
        private async void TermInOfficeERL_TestNewTermInOfficeERL()
        {
            var eventEdit = await TermInOfficeERL.NewTermInOfficeERL();

            Assert.NotNull(eventEdit);
            Assert.IsType <TermInOfficeERL>(eventEdit);
        }
コード例 #2
0
        private async void TermInOfficeERL_TestGetTermInOfficeERL()
        {
            var eventEdit =
                await TermInOfficeERL.GetTermInOfficeERL();

            Assert.NotNull(eventEdit);
            Assert.Equal(3, eventEdit.Count);
        }
コード例 #3
0
        private async void TermInOfficeERL_TestAddTermInOfficeERL()
        {
            var eventList =
                await TermInOfficeERL.GetTermInOfficeERL();

            var countBeforeAdd = eventList.Count;

            var eventToAdd = eventList.AddNew();

            await BuildTermInOffice(eventToAdd);

            var updatedTermInOfficeList = await eventList.SaveAsync();

            Assert.NotEqual(countBeforeAdd, updatedTermInOfficeList.Count);
        }
コード例 #4
0
        private async void TermInOfficeERL_TestUpdateTermInOfficeERL()
        {
            const int ID_TO_UPDATE = 1;

            var eventList =
                await TermInOfficeERL.GetTermInOfficeERL();

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

            eventToUpdate.Notes = "Updated Notes";

            var updatedList = await eventList.SaveAsync();

            Assert.Equal(countBeforeUpdate, updatedList.Count);
        }
コード例 #5
0
        private async void TermInOfficeERL_TestDeleteTermInOfficeERL()
        {
            const int ID_TO_DELETE = 99;
            var       eventList    =
                await TermInOfficeERL.GetTermInOfficeERL();

            var listCount     = eventList.Count;
            var eventToDelete = eventList.First(cl => cl.Id == ID_TO_DELETE);
            // remove is deferred delete
            var isDeleted = eventList.Remove(eventToDelete);

            var eventListAfterDelete = await eventList.SaveAsync();

            Assert.NotNull(eventListAfterDelete);
            Assert.IsType <TermInOfficeERL>(eventListAfterDelete);
            Assert.True(isDeleted);
            Assert.NotEqual(listCount, eventListAfterDelete.Count);
        }