public void FieldIndexHandler_ReferenceIndexHandler()
        {
            Test(() =>
            {
                var content     = Content.Load(Identifiers.PortalRootId);
                var contentName = content.Name;
                var snField     = content.Fields["CreatedBy"];

                var fieldIndexHandler = new ReferenceIndexHandler();
                fieldIndexHandler.OwnerIndexingInfo = snField.FieldSetting.IndexingInfo;

                var indexed = fieldIndexHandler.GetIndexFields(snField, out _);
                Assert.AreEqual(IndexValueType.IntArray, indexed.First().Type);
                var parsed = fieldIndexHandler.Parse("2");
                Assert.AreEqual(IndexValueType.Int, parsed.Type);
                var termValue = fieldIndexHandler.ConvertToTermValue(User.Administrator);
                Assert.AreEqual(parsed.Type, termValue.Type);

                var retrieved = fieldIndexHandler.GetBack("42");
                Assert.AreEqual(42, retrieved);
            });
        }
        public void FieldIndexHandler_ReferenceIndexHandler_Multi()
        {
            var nodeIds     = new[] { 1, 3, 5, 7 };
            var expectation = new[]
            {
                new IndexField("Refs", nodeIds, IndexingMode.NotAnalyzed, IndexStoringMode.No, IndexTermVector.No)
            };
            var references = nodeIds.Select(id => new TestNode {
                Id = id
            }).ToArray();
            var snField           = new TestMultiRefField("Refs", references);
            var fieldIndexHandler = new ReferenceIndexHandler
            {
                OwnerIndexingInfo = new TestPerfieldIndexingInfoInt {
                    IndexStoringMode = IndexStoringMode.No
                }
            };

            // ACTION
            var indexed = fieldIndexHandler.GetIndexFields(snField, out _).ToArray();

            // ASSERT
            indexed.Should().BeEquivalentTo(expectation);
        }