Exemple #1
0
        public async Task OrganizationER_Delete()
        {
            await OrganizationER.DeleteOrganizationER(99);

            var organizationToCheck = await Assert.ThrowsAsync <Csla.DataPortalException>
                                          (() => OrganizationER.GetOrganizationER(99));
        }
Exemple #2
0
        public async Task OrganizationER_Get()
        {
            var organization = await OrganizationER.GetOrganizationER(1);

            Assert.NotNull(organization);
            Assert.IsType <OrganizationER>(organization);
            Assert.Equal(1, organization.Id);
            Assert.True(organization.IsValid);
        }
Exemple #3
0
        public async void OrganizationER_Update()
        {
            var organization = await OrganizationER.GetOrganizationER(1);

            var notesUpdate = $"These are updated description.";

            organization.Notes = notesUpdate;

            var result = await organization.SaveAsync();

            Assert.NotNull(result);
            Assert.Equal(notesUpdate, result.Notes);
        }
Exemple #4
0
        public async Task OrganizationER_TestSaveOutOfOrder()
        {
            var organization1 = await OrganizationER.GetOrganizationER(1);

            var organization2 = await OrganizationER.GetOrganizationER(1);

            organization1.Notes = "set up timestamp issue"; // turn on IsDirty
            organization2.Notes = "set up timestamp issue";

            var organization2_2 = await organization2.SaveAsync();

            Assert.NotEqual(organization2_2.RowVersion, organization1.RowVersion);
            Assert.Equal("set up timestamp issue", organization2_2.Notes);
            await Assert.ThrowsAsync <DataPortalException>(() => organization1.SaveAsync());
        }
Exemple #5
0
        public async Task OrganizationER_TestSubsequentSaves()
        {
            var organization = await OrganizationER.GetOrganizationER(1);

            organization.Notes = "set up timestamp issue"; // turn on IsDirty

            var organization2 = await organization.SaveAsync();

            var rowVersion1 = organization2.RowVersion;

            organization2.Notes = "another timestamp trigger";

            var organization3 = await organization2.SaveAsync();

            Assert.NotEqual(organization2.RowVersion, organization3.RowVersion);
        }
Exemple #6
0
 public async Task OrganizationER_InvalidGet()
 {
     await Assert.ThrowsAsync <DataPortalException>(() => OrganizationER.GetOrganizationER(999));
 }