Ejemplo n.º 1
0
        public void AttachReturnsCorrectResponse_WithIndexingMode()
        {
            Mock <ContainerBuilder> mockContainerPolicyDefinition = new Mock <ContainerBuilder>();
            Action <IndexingPolicy> callback = (policy) =>
            {
                Assert.IsFalse(policy.Automatic);
                Assert.AreEqual(IndexingMode.None, policy.IndexingMode);
            };

            IndexingPolicyDefinition <ContainerBuilder> indexingPolicyFluentDefinitionCore = new IndexingPolicyDefinition <ContainerBuilder>(
                mockContainerPolicyDefinition.Object,
                callback);

            indexingPolicyFluentDefinitionCore
            .WithIndexingMode(IndexingMode.None)
            .WithAutomaticIndexing(false)
            .Attach();
        }
Ejemplo n.º 2
0
        public void AttachReturnsCorrectResponse_WithCompositeIndex()
        {
            Mock <ContainerBuilder> mockContainerPolicyDefinition = new Mock <ContainerBuilder>();
            Action <IndexingPolicy> callback = (policy) =>
            {
                Assert.AreEqual(1, policy.CompositeIndexes.Count);
                Assert.AreEqual("/path", policy.CompositeIndexes[0][0].Path);
            };

            IndexingPolicyDefinition <ContainerBuilder> indexingPolicyFluentDefinitionCore = new IndexingPolicyDefinition <ContainerBuilder>(
                mockContainerPolicyDefinition.Object,
                callback);

            indexingPolicyFluentDefinitionCore
            .WithCompositeIndex()
            .Path("/path")
            .Attach()
            .Attach();
        }