public async Task TestEMailER_New() { var eMail = await EMailER.NewEMailER(); Assert.NotNull(eMail); Assert.False(eMail.IsValid); }
public async Task TestEMailER_TestInvalidSave() { var eMail = await EMailER.NewEMailER(); await BuildEMail(eMail); eMail.EMailAddress = string.Empty; Assert.False(eMail.IsValid); await Assert.ThrowsAsync <ValidationException>(() => eMail.SaveAsync()); }
public async void TestEMailER_Insert() { var eMail = await EMailER.NewEMailER(); await BuildEMail(eMail); var savedEMail = await eMail.SaveAsync(); Assert.NotNull(savedEMail); Assert.IsType <EMailER>(savedEMail); Assert.True(savedEMail.Id > 0); }
public async Task TestEMailER_LastUpdatedByRequired() { var eMailType = await EMailER.NewEMailER(); await BuildEMail(eMailType); var isObjectValidInit = eMailType.IsValid; eMailType.LastUpdatedBy = string.Empty; Assert.NotNull(eMailType); Assert.True(isObjectValidInit); Assert.False(eMailType.IsValid); Assert.Equal("LastUpdatedBy", eMailType.BrokenRulesCollection[0].Property); Assert.Equal("LastUpdatedBy required", eMailType.BrokenRulesCollection[0].Description); }
public async Task TestEMailER_EMailAddressRequired() { var eMail = await EMailER.NewEMailER(); await BuildEMail(eMail); var isObjectValidInit = eMail.IsValid; eMail.EMailAddress = string.Empty; Assert.NotNull(eMail); Assert.True(isObjectValidInit); Assert.False(eMail.IsValid); Assert.Equal("EMailAddress", eMail.BrokenRulesCollection[0].Property); Assert.Equal("EMailAddress required", eMail.BrokenRulesCollection[0].Description); }
public async Task TestEMailER_EMailAddressMaxLengthLessThan255() { var eMailType = await EMailER.NewEMailER(); await BuildEMail(eMailType); var isObjectValidInit = eMailType.IsValid; eMailType.EMailAddress = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor " + "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis " + "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. " + "Duis aute irure dolor in reprehenderit"; Assert.NotNull(eMailType); Assert.True(isObjectValidInit); Assert.False(eMailType.IsValid); Assert.Equal("EMailAddress", eMailType.BrokenRulesCollection[0].Property); Assert.Equal("EMailAddress can not exceed 255 characters", eMailType.BrokenRulesCollection[0].Description); }