Exemplo n.º 1
0
        public void IndexCanIncludeCustomFieldsOutsideOfTheSolidityEvent()
        {
            var searchIndex = new EventIndexDefinition <CustomEventDtoA>();

            var customEventDto = new CustomEventDtoA()
            {
                Category = "CatA"
            };

            searchIndex
            .Assertions(new EventLog <CustomEventDtoA>(customEventDto, null))
            .HasField(nameof(customEventDto.Category),
                      f => f.IsString(),
                      f => f.HasFlags(isFacetable: true, isSearchable: true, isFilterable: true, isSortable: true),
                      f => f.ReturnsValue(customEventDto.Category));
        }
Exemplo n.º 2
0
        public void IndexCanIncludeCustomFieldsOutsideOfTheSolidityEvent()
        {
            var searchIndex = new EventSearchIndexDefinition <CustomEventDtoA>();

            var categoryField = searchIndex.Field("Category");

            Assert.NotNull(categoryField);
            Assert.False(categoryField.Ignore);
            Assert.False(categoryField.IsKey);
            Assert.True(categoryField.IsFacetable);
            Assert.True(categoryField.IsSearchable);
            Assert.True(categoryField.IsFilterable);
            Assert.True(categoryField.IsSortable);

            var customEventDto = new CustomEventDtoA()
            {
                Category = "CatA"
            };

            Assert.Equal(customEventDto.Category, categoryField.EventValue(customEventDto));
        }