コード例 #1
0
        public async Task MemberInfoER_DeleteObjectFromDatabase()
        {
            const int ID_TO_DELETE = 99;

            await MemberInfoER.DeleteMemberInfoER(ID_TO_DELETE);

            var categoryToCheck = await Assert.ThrowsAsync <Csla.DataPortalException>
                                      (() => MemberInfoER.GetMemberInfoER(ID_TO_DELETE));
        }
コード例 #2
0
        public async void MemberInfoER_Get()
        {
            var memberInfo = await MemberInfoER.GetMemberInfoER(1);

            Assert.NotNull(memberInfo.Person);
            Assert.NotNull(memberInfo.MembershipType);
            Assert.NotNull(memberInfo.MemberStatus);
            Assert.NotNull(memberInfo.PrivacyLevel);
            Assert.Equal(1, memberInfo.Id);
            Assert.True(memberInfo.IsValid);
        }
コード例 #3
0
        public async void MemberInfoER_UpdateExistingObjectInDatabase()
        {
            var newMemberNumber = "1234567890";
            var memberInfo      = await MemberInfoER.GetMemberInfoER(1);

            memberInfo.MemberNumber = newMemberNumber;

            var result = await memberInfo.SaveAsync();

            Assert.NotNull(result);
            Assert.Equal(newMemberNumber, result.MemberNumber);
        }
コード例 #4
0
        public async Task TestMemberInfoER_LastUpdatedDateRequired()
        {
            var memberInfoToTest = await BuildMemberInfo();

            var memberInfo = await MemberInfoER.GetMemberInfoER(1);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.LastUpdatedDate = DateTime.MinValue;

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("LastUpdatedDate", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedDate required", memberInfo.BrokenRulesCollection[0].Description);
        }
コード例 #5
0
        public async Task TestMemberInfoER_MembershipTypeRequired()
        {
            var memberInfoToTest = await BuildMemberInfo();

            var memberInfo = await MemberInfoER.GetMemberInfoER(1);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.MembershipType = null;

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("MembershipType", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("MembershipType required", memberInfo.BrokenRulesCollection[0].Description);
        }
コード例 #6
0
        public async Task TestMemberInfoER_LastUpdatedByExceeds255Characters()
        {
            var memberInfoToTest = await BuildMemberInfo();

            var memberInfo = await MemberInfoER.GetMemberInfoER(1);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.LastUpdatedBy = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo" +
                                       "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 in voluptate velit esse cillum dolore eu fugiat nulla pariatur.";

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("LastUpdatedBy", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedBy can not exceed 255 characters",
                         memberInfo.BrokenRulesCollection[0].Description);
        }