コード例 #1
0
        private async void DocumentTypeERL_TestGetDocumentTypeERL()
        {
            var categoryOfPersonEdit =
                await DocumentTypeERL.GetDocumentTypeERL();

            Assert.NotNull(categoryOfPersonEdit);
            Assert.Equal(3, categoryOfPersonEdit.Count);
        }
コード例 #2
0
        private async void DocumentTypeERL_TestAddDocumentTypeERL()
        {
            var categoryList =
                await DocumentTypeERL.GetDocumentTypeERL();

            var countBeforeAdd = categoryList.Count;

            var categoryOfPersonToAdd = categoryList.AddNew();

            BuildDocumentType(categoryOfPersonToAdd);

            var updatedCategoryList = await categoryList.SaveAsync();

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

            var categoryList =
                await DocumentTypeERL.GetDocumentTypeERL();

            var countBeforeUpdate        = categoryList.Count;
            var categoryOfPersonToUpdate = categoryList.First(cl => cl.Id == ID_TO_UPDATE);

            categoryOfPersonToUpdate.Notes = "Updated Notes";

            var updatedList = await categoryList.SaveAsync();

            Assert.Equal(countBeforeUpdate, updatedList.Count);
        }
コード例 #4
0
        private async void DocumentTypeERL_TestDeleteDocumentTypeERL()
        {
            const int ID_TO_DELETE = 99;
            var       categoryList =
                await DocumentTypeERL.GetDocumentTypeERL();

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

            var categoryOfPersonListAfterDelete = await categoryList.SaveAsync();

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