private async void OrganizationERL_TestGetOrganizationERL() { var organizationEdit = await OrganizationERL.GetOrganizationERL(); Assert.NotNull(organizationEdit); Assert.Equal(3, organizationEdit.Count); }
private async void OrganizationERL_TestAddOrganizationsEntry() { var organizationEditList = await OrganizationERL.GetOrganizationERL(); var countBeforeAdd = organizationEditList.Count; var organizationToAdd = organizationEditList.AddNew(); await BuildOrganization(organizationToAdd); var updatedOrganizationsList = await organizationEditList.SaveAsync(); Assert.NotEqual(countBeforeAdd, updatedOrganizationsList.Count); }
private async void OrganizationERL_TestUpdateOrganizationsEntry() { const int idToUpdate = 1; var organizationEditList = await OrganizationERL.GetOrganizationERL(); var countBeforeUpdate = organizationEditList.Count; var organizationToUpdate = organizationEditList.First(a => a.Id == idToUpdate); organizationToUpdate.Name = "This was updated"; var updatedList = await organizationEditList.SaveAsync(); Assert.Equal("This was updated", updatedList.First(a => a.Id == idToUpdate).Name); Assert.Equal(countBeforeUpdate, updatedList.Count); }
private async void OrganizationERL_TestDeleteOrganizationsEntry() { var organizationEdit = await OrganizationERL.GetOrganizationERL(); var listCount = organizationEdit.Count; var organizationToDelete = organizationEdit.First(et => et.Id == 99); // remove is deferred delete var isDeleted = organizationEdit.Remove(organizationToDelete); var organizationListAfterDelete = await organizationEdit.SaveAsync(); Assert.NotNull(organizationListAfterDelete); Assert.IsType <OrganizationERL>(organizationListAfterDelete); Assert.True(isDeleted); Assert.NotEqual(listCount, organizationListAfterDelete.Count); }