示例#1
0
        public async Task TestPrivacyLevelEC_NewPrivacyLevelEC()
        {
            var privacyLevel = await PrivacyLevelEC.NewPrivacyLevelEC();

            Assert.NotNull(privacyLevel);
            Assert.IsType <PrivacyLevelEC>(privacyLevel);
            Assert.False(privacyLevel.IsValid);
        }
示例#2
0
        public async Task TestPrivacyLevelEC_GetPrivacyLevelEC()
        {
            var privacyLevelToLoad = BuildPrivacyLevel();
            var privacyLevel       = await PrivacyLevelEC.GetPrivacyLevelEC(privacyLevelToLoad);

            Assert.NotNull(privacyLevel);
            Assert.IsType <PrivacyLevelEC>(privacyLevel);
            Assert.Equal(privacyLevelToLoad.Id, privacyLevel.Id);
            Assert.Equal(privacyLevelToLoad.Description, privacyLevel.Description);
            Assert.Equal(privacyLevelToLoad.Notes, privacyLevel.Notes);
            Assert.Equal(privacyLevelToLoad.RowVersion, privacyLevel.RowVersion);
            Assert.True(privacyLevel.IsValid);
        }
示例#3
0
        public async Task TestPrivacyLevelEC_DescriptionRequired()
        {
            var privacyLevelToTest = BuildPrivacyLevel();
            var privacyLevel       = await PrivacyLevelEC.GetPrivacyLevelEC(privacyLevelToTest);

            var isObjectValidInit = privacyLevel.IsValid;

            privacyLevel.Description = string.Empty;

            Assert.NotNull(privacyLevel);
            Assert.True(isObjectValidInit);
            Assert.False(privacyLevel.IsValid);
            Assert.Equal("Description", privacyLevel.BrokenRulesCollection[0].Property);
        }
示例#4
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;
        }
示例#5
0
        public async Task TestPrivacyLevelEC_DescriptionLessThan50Chars()
        {
            var privacyLevelToTest = BuildPrivacyLevel();
            var privacyLevel       = await PrivacyLevelEC.GetPrivacyLevelEC(privacyLevelToTest);

            var isObjectValidInit = privacyLevel.IsValid;

            privacyLevel.Description =
                "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(privacyLevel);
            Assert.True(isObjectValidInit);
            Assert.False(privacyLevel.IsValid);
            Assert.Equal("Description", privacyLevel.BrokenRulesCollection[0].Property);
        }
 private void BuildPrivacyLevel(PrivacyLevelEC categoryToBuild)
 {
     categoryToBuild.Description = "description for doctype";
     categoryToBuild.Notes       = "notes for doctype";
 }
 private void BuildPrivacyLevel(PrivacyLevelEC privacyLevel)
 {
     privacyLevel.Description = "doc type description";
     privacyLevel.Notes       = "document type notes";
 }