Beispiel #1
0
        public async void MemberInfoEC_GetNewObject()
        {
            var memberInfo = await MemberInfoEC.NewMemberInfoEC();

            Assert.NotNull(memberInfo);
            Assert.False(memberInfo.IsValid);
        }
        private async void MemberInfoERL_TestAddMemberInfoEntry()
        {
            var memberInfoEditList = await MemberInfoERL.GetMemberInfoERL();

            var countBeforeAdd = memberInfoEditList.Count;

            var memberInfoToAdd = await MemberInfoEC.GetMemberInfoEC(await BuildMemberInfo());

            memberInfoEditList.Add(memberInfoToAdd);
            var updatedMemberInfosList = await memberInfoEditList.SaveAsync();

            Assert.NotEqual(countBeforeAdd, updatedMemberInfosList.Count);
        }
Beispiel #3
0
        public async Task MemberInfoEC_MemberNumberRequired()
        {
            var memberInfo = await MemberInfoEC.NewMemberInfoEC();

            await BuildMemberInfoEC(memberInfo);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.MemberNumber = String.Empty;

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
        }
Beispiel #4
0
        public async Task TestMemberInfoEC_DateFirstJoinedRequired()
        {
            var memberInfoToTest = BuildMemberInfo();
            var memberInfo       = await MemberInfoEC.GetMemberInfoEC(memberInfoToTest);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.DateFirstJoined = DateTime.MinValue;

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("DateFirstJoined", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("DateFirstJoined required", memberInfo.BrokenRulesCollection[0].Description);
        }
Beispiel #5
0
        public async Task TestMemberInfoEC_LastUpdatedByRequired()
        {
            var memberInfoToTest = BuildMemberInfo();
            var memberInfo       = await MemberInfoEC.GetMemberInfoEC(memberInfoToTest);

            var isObjectValidInit = memberInfo.IsValid;

            memberInfo.LastUpdatedBy = string.Empty;

            Assert.NotNull(memberInfo);
            Assert.True(isObjectValidInit);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("LastUpdatedBy", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedBy required", memberInfo.BrokenRulesCollection[0].Description);
        }
Beispiel #6
0
        public async Task TestMemberInfoEC_MembershipTypeRequired()
        {
            var memberInfoToTest = BuildMemberInfo();
            var memberInfo       = await MemberInfoEC.GetMemberInfoEC(memberInfoToTest);

            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);
        }
Beispiel #7
0
        public async void MemberInfoEC_Get()
        {
            var memberInfoObj = BuildMemberInfo();
            var memberInfo    = await MemberInfoEC.GetMemberInfoEC(memberInfoObj);

            Assert.NotNull(memberInfo.Person);
            Assert.NotNull(memberInfo.MembershipType);
            Assert.NotNull(memberInfo.MemberStatus);
            Assert.NotNull(memberInfo.PrivacyLevel);
            Assert.Equal(memberInfoObj.Notes, memberInfo.Notes);
            Assert.Equal(memberInfoObj.MemberNumber, memberInfo.MemberNumber);
            Assert.Equal(new SmartDate(memberInfoObj.DateFirstJoined), memberInfo.DateFirstJoined);
            Assert.Equal(new SmartDate(memberInfoObj.LastUpdatedDate), memberInfo.LastUpdatedDate);
            Assert.Equal(memberInfoObj.LastUpdatedBy, memberInfo.LastUpdatedBy);
            Assert.Equal(1, memberInfo.Id);
            Assert.True(memberInfo.IsValid);
        }
Beispiel #8
0
        public async Task MemberInfoEC_MemberNumberExceedsMaxLengthOf35()
        {
            var memberInfo = await MemberInfoEC.NewMemberInfoEC();

            await BuildMemberInfoEC(memberInfo);

            Assert.True(memberInfo.IsValid);

            memberInfo.MemberNumber =
                "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 ";

            Assert.NotNull(memberInfo);
            Assert.False(memberInfo.IsValid);
            Assert.Equal("MemberNumber", memberInfo.BrokenRulesCollection[0].Property);
            Assert.Equal("MemberNumber can not exceed 35 characters",
                         memberInfo.BrokenRulesCollection[0].Description);
        }
Beispiel #9
0
        private async Task BuildMemberInfoEC(MemberInfoEC memberInfo)
        {
            var domainInfo = BuildMemberInfo();

            memberInfo.Notes  = domainInfo.Notes;
            memberInfo.Person = await PersonEC.GetPersonEC(domainInfo.Person);

            memberInfo.MemberNumber   = domainInfo.MemberNumber;
            memberInfo.MembershipType = await MembershipTypeEC.GetMembershipTypeEC(domainInfo.MembershipType);

            memberInfo.MemberStatus = await MemberStatusEC.GetMemberStatusEC(domainInfo.MemberStatus);

            memberInfo.PrivacyLevel = await PrivacyLevelEC.GetPrivacyLevelEC(domainInfo.PrivacyLevel);

            memberInfo.DateFirstJoined = new SmartDate(DateTime.Now);
            memberInfo.LastUpdatedBy   = domainInfo.LastUpdatedBy;
            memberInfo.LastUpdatedDate = domainInfo.LastUpdatedDate;
        }
Beispiel #10
0
        public async Task TestMemberInfoEC_LastUpdatedByExceeds255Characters()
        {
            var memberInfoToTest = BuildMemberInfo();
            var memberInfo       = await MemberInfoEC.GetMemberInfoEC(memberInfoToTest);

            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);
        }
        private async Task <EventMemberER> BuildEventMember()
        {
            var eventDocumentObj = await EventMemberER.NewEventMemberER();

            eventDocumentObj.Event = await EventEC.GetEventEC(new Event()
            {
                Id = 1
            });

            eventDocumentObj.MemberInfo = await MemberInfoEC.GetMemberInfoEC(new MemberInfo()
            {
                Id = 1
            });

            eventDocumentObj.Role            = "Organizer";
            eventDocumentObj.LastUpdatedBy   = "edm";
            eventDocumentObj.LastUpdatedDate = DateTime.Now;
            eventDocumentObj.Notes           = "notes for doctype";

            return(eventDocumentObj);
        }