Beispiel #1
0
        private async void PrivacyLevelEditList_TestGetPrivacyLevelEditList()
        {
            var privacyLevelErl = await PrivacyLevelEditList.GetPrivacyLevelEditList();

            Assert.NotNull(privacyLevelErl);
            Assert.Equal(3, privacyLevelErl.Count);
        }
Beispiel #2
0
        private async void PrivacyLevelEditList_TestNewPrivacyLevelEditList()
        {
            var privacyLevelErl = await PrivacyLevelEditList.NewPrivacyLevelEditList();

            Assert.NotNull(privacyLevelErl);
            Assert.IsType <PrivacyLevelEditList>(privacyLevelErl);
        }
Beispiel #3
0
        private async void PrivacyLevelEditList_TestAddPrivacyLevelsEntry()
        {
            var privacyLevelEditList = await PrivacyLevelEditList.GetPrivacyLevelEditList();

            var countBeforeAdd = privacyLevelEditList.Count;

            var privacyLevelToAdd = privacyLevelEditList.AddNew();

            BuildPrivacyLevel(privacyLevelToAdd);

            var updatedPrivacyLevelsList = await privacyLevelEditList.SaveAsync();

            Assert.NotEqual(countBeforeAdd, updatedPrivacyLevelsList.Count);
        }
Beispiel #4
0
        private async void PrivacyLevelEditList_TestUpdatePrivacyLevelsEntry()
        {
            const int idToUpdate = 1;

            var privacyLevelEditList = await PrivacyLevelEditList.GetPrivacyLevelEditList();

            var countBeforeUpdate    = privacyLevelEditList.Count;
            var privacyLevelToUpdate = privacyLevelEditList.First(a => a.Id == idToUpdate);

            privacyLevelToUpdate.Description = "This was updated";

            var updatedList = await privacyLevelEditList.SaveAsync();

            Assert.Equal("This was updated", updatedList.First(a => a.Id == idToUpdate).Description);
            Assert.Equal(countBeforeUpdate, updatedList.Count);
        }
Beispiel #5
0
        private async void PrivacyLevelEditList_TestDeletePrivacyLevelsEntry()
        {
            var privacyLevelErl = await PrivacyLevelEditList.GetPrivacyLevelEditList();

            var listCount            = privacyLevelErl.Count;
            var privacyLevelToDelete = privacyLevelErl.First(et => et.Id == 99);

            // remove is deferred delete
            var isDeleted = privacyLevelErl.Remove(privacyLevelToDelete);

            var privacyLevelListAfterDelete = await privacyLevelErl.SaveAsync();

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