Ejemplo n.º 1
0
        public async Task FilterBy_MultiValuePropertyWithBothDifferentValue_DoNotSetUserGroup()
        {
            var multiValueDynamicPropertyWithBothDifferentValues = (DynamicObjectProperty)MultiValueDynamicPropertyWithMultipleValues.Clone();

            multiValueDynamicPropertyWithBothDifferentValues.Values = new[]
            {
                new DynamicPropertyObjectValue {
                    Value = "Test1", ValueType = DynamicPropertyValueType.ShortText
                },
                new DynamicPropertyObjectValue {
                    Value = "Test2", ValueType = DynamicPropertyValueType.ShortText
                }
            };
            var segment = CreateCustomerSegment(
                new[] { multiValueDynamicPropertyWithBothDifferentValues },
                new[] { "Store" },
                "Test");
            var customer = GetCustomer(MultiValueDynamicPropertyWithMultipleValues);

            var documents = await BuildIndexDocuments(segment, customer);

            Assert.Null(GetUserGroups(documents[0]));
        }
Ejemplo n.º 2
0
        public async Task FilterBy_MultiValuePropertyWithOneDifferentValue_SetUserGroup()
        {
            var multiValueDynamicPropertyWithOneDifferentValues = (DynamicObjectProperty)MultiValueDynamicPropertyWithMultipleValues.Clone();

            multiValueDynamicPropertyWithOneDifferentValues.Values.First().Value = "Test";
            var segment = CreateCustomerSegment(
                new[] { multiValueDynamicPropertyWithOneDifferentValues },
                new[] { "Store" },
                "Test");
            var customer = GetCustomer(MultiValueDynamicPropertyWithMultipleValues);

            var documents = await BuildIndexDocuments(segment, customer);

            Assert.Equal("Test", GetUserGroups(documents[0]).ToString());
        }