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); }
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); }
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); }
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); }
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; }
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; }