Exemplo n.º 1
0
        public async Task TestEMailER_Delete()
        {
            await EMailER.DeleteEMailER(99);

            await Assert.ThrowsAsync <Csla.DataPortalException>
                (() => EMailER.GetEMailER(99));
        }
Exemplo n.º 2
0
        public async Task TestEMailER_Get()
        {
            var eMail = await EMailER.GetEMailER(1);

            Assert.NotNull(eMail);
            Assert.IsType <EMailER>(eMail);
            Assert.NotNull(eMail.EMailType);
            Assert.Equal(1, eMail.Id);
            Assert.True(eMail.IsValid);
        }
Exemplo n.º 3
0
        public async Task EMailTypeER_UpdateEMailType()
        {
            const string NOTES_UPDATE = "test child update";

            var email = await EMailER.GetEMailER(1);

            email.EMailType.Notes = NOTES_UPDATE;

            var result = await email.SaveAsync();

            Assert.NotNull(result);
            Assert.Equal(NOTES_UPDATE, result.EMailType.Notes);
        }
Exemplo n.º 4
0
        public async void TestEMailER_Update()
        {
            var eMail = await EMailER.GetEMailER(1);

            var notesUpdate = $"These are updated Notes {DateTime.Now}";

            eMail.Notes = notesUpdate;

            var result = await eMail.SaveAsync();

            Assert.NotNull(result);
            Assert.Equal(notesUpdate, result.Notes);
        }
Exemplo n.º 5
0
        public async Task EMailER_TestSaveOutOfOrder()
        {
            var emailType1 = await EMailER.GetEMailER(1);

            var emailType2 = await EMailER.GetEMailER(1);

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

            var emailType2_2 = await emailType2.SaveAsync();

            Assert.NotEqual(emailType2_2.RowVersion, emailType1.RowVersion);
            Assert.Equal("set up timestamp issue", emailType2_2.Notes);
            await Assert.ThrowsAsync <DataPortalException>(() => emailType1.SaveAsync());
        }
Exemplo n.º 6
0
        public async Task EMailER_TestSubsequentSaves()
        {
            var emailType = await EMailER.GetEMailER(1);

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

            var emailType2 = await emailType.SaveAsync();

            var rowVersion1 = emailType2.RowVersion;

            emailType2.Notes = "another timestamp trigger";

            var emailType3 = await emailType2.SaveAsync();

            Assert.NotEqual(emailType2.RowVersion, emailType3.RowVersion);
        }
Exemplo n.º 7
0
 public async Task TestEMailER_InvalidGet()
 {
     await Assert.ThrowsAsync <DataPortalException>(() => EMailER.GetEMailER(999));
 }