Пример #1
0
        public async Task ContactForSponsorEC_LastUpdatedDateRequired()
        {
            var contactToTest = BuildContactForSponsor();
            var contact       = await ContactForSponsorEC.GetContactForSponsorEC(contactToTest);

            var isObjectValidInit = contact.IsValid;

            contact.LastUpdatedDate = DateTime.MinValue;

            Assert.NotNull(contact);
            Assert.True(isObjectValidInit);
            Assert.False(contact.IsValid);
            Assert.Equal("LastUpdatedDate", contact.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedDate required", contact.BrokenRulesCollection[0].Description);
        }
Пример #2
0
        public async Task ContactForSponsorEC_LastUpdatedDateRequired()
        {
            var contactForSponsorToLoad = MockDb.ContactForSponsors.Single(cs => cs.Id == 1);
            var category = await ContactForSponsorEC.GetContactForSponsorEC(contactForSponsorToLoad);

            var isObjectValidInit = category.IsValid;

            category.LastUpdatedDate = DateTime.MinValue;

            Assert.NotNull(category);
            Assert.True(isObjectValidInit);
            Assert.False(category.IsValid);
            Assert.Equal("LastUpdatedDate", category.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedDate required", category.BrokenRulesCollection[0].Description);
        }
Пример #3
0
        public async Task ContactForSponsorEC_GetContactForSponsorEC()
        {
            var contactForSponsorToLoad = MockDb.ContactForSponsors.Single(cs => cs.Id == 1);
            var contactForSponsor       = await ContactForSponsorEC.GetContactForSponsorEC(contactForSponsorToLoad);

            Assert.NotNull(contactForSponsor);
            Assert.IsType <ContactForSponsorEC>(contactForSponsor);
            Assert.Equal(contactForSponsorToLoad.Id, contactForSponsor.Id);
            Assert.Equal(new SmartDate(contactForSponsorToLoad.DateWhenContacted), contactForSponsor.DateWhenContacted);
            Assert.Equal(contactForSponsorToLoad.LastUpdatedBy, contactForSponsor.LastUpdatedBy);
            Assert.Equal(new SmartDate(contactForSponsorToLoad.LastUpdatedDate), contactForSponsor.LastUpdatedDate);
            Assert.Equal(contactForSponsorToLoad.Notes, contactForSponsor.Notes);
            Assert.Equal(contactForSponsorToLoad.RowVersion, contactForSponsor.RowVersion);
            Assert.True(contactForSponsor.IsValid);
        }
Пример #4
0
        public async Task ContactForSponsorEC_PurposeLessThan255Chars()
        {
            var contactForSponsorToLoad = MockDb.ContactForSponsors.Single(cs => cs.Id == 1);
            var category = await ContactForSponsorEC.GetContactForSponsorEC(contactForSponsorToLoad);

            var isObjectValidInit = category.IsValid;

            category.Purpose = "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 " +
                               "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis " +
                               "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis ";

            Assert.NotNull(category);
            Assert.True(isObjectValidInit);
            Assert.False(category.IsValid);
            Assert.Equal("Purpose", category.BrokenRulesCollection[0].Property);
        }