コード例 #1
0
        private static MemberFacetFreeText CreateFreeTextMemberFacet(Member member, Facet textFacet)
        {
            var facet = new MemberFacetFreeText
            {
                FacetId       = textFacet.Id,
                MemberId      = member.Id,
                FreeTextValue = "Aardvark"
            };

            facet = new MemberFacets().Insert(facet);
            return(facet);
        }
コード例 #2
0
        public void AllMemberFacets()
        {
            var member = CreateBob();

            var listFacet = FacetSetUpHelper.CreateListFacet();
            var textFacet = FacetSetUpHelper.CreateFreeTextFacet();

            var expectedMemberListFacet = CreateListMemberFacet(member, listFacet);
            var expectedMemberTextFacet = CreateFreeTextMemberFacet(member, textFacet);

            var facets = new MemberFacets().ForMember(member.Id).ToList();

            var actualMemberListFacet = facets.OfType<MemberFacetList>().FirstOrDefault();
            Assert.IsNotNull(actualMemberListFacet);
            Assert.AreEqual(2, actualMemberListFacet.Values.Count);

            var actualMemberTextFacet = facets.OfType<MemberFacetFreeText>().FirstOrDefault();
            Assert.IsNotNull(actualMemberTextFacet);
        }
コード例 #3
0
        private static MemberFacetList CreateListMemberFacet(Member member, Facet listFacet)
        {
            var facet = new MemberFacetList
            {
                FacetId  = listFacet.Id,
                MemberId = member.Id,
                Values   = new List <MemberFacetValue>
                {
                    new MemberFacetValue {
                        FacetValueId = listFacet.Values.First().Id
                    },
                    new MemberFacetValue {
                        FacetValueId = listFacet.Values.Last().Id
                    },
                }
            };

            facet = new MemberFacets().Insert(facet);
            return(facet);
        }
コード例 #4
0
        public void AllMemberFacets()
        {
            var member = CreateBob();

            var listFacet = FacetSetUpHelper.CreateListFacet();
            var textFacet = FacetSetUpHelper.CreateFreeTextFacet();

            var expectedMemberListFacet = CreateListMemberFacet(member, listFacet);
            var expectedMemberTextFacet = CreateFreeTextMemberFacet(member, textFacet);

            var facets = new MemberFacets().ForMember(member.Id).ToList();

            var actualMemberListFacet = facets.OfType <MemberFacetList>().FirstOrDefault();

            Assert.IsNotNull(actualMemberListFacet);
            Assert.AreEqual(2, actualMemberListFacet.Values.Count);

            var actualMemberTextFacet = facets.OfType <MemberFacetFreeText>().FirstOrDefault();

            Assert.IsNotNull(actualMemberTextFacet);
        }
コード例 #5
0
 private static MemberFacetList CreateListMemberFacet(Member member, Facet listFacet)
 {
     var facet = new MemberFacetList
                     {
                         FacetId = listFacet.Id,
                         MemberId = member.Id,
                         Values = new List<MemberFacetValue>
                                      {
                                          new MemberFacetValue {FacetValueId = listFacet.Values.First().Id},
                                          new MemberFacetValue {FacetValueId = listFacet.Values.Last().Id},
                                      }
                     };
     facet = new MemberFacets().Insert(facet);
     return facet;
 }
コード例 #6
0
 private static MemberFacetFreeText CreateFreeTextMemberFacet(Member member, Facet textFacet)
 {
     var facet = new MemberFacetFreeText
                     {
                         FacetId = textFacet.Id,
                         MemberId = member.Id,
                         FreeTextValue = "Aardvark"
                     };
     facet = new MemberFacets().Insert(facet);
     return facet;
 }