예제 #1
0
        public void ShouldMarkMapReduceIndexAsErroredWhenItProducesTooManyOutputsPerDocument()
        {
            using (var store = NewDocumentStore())
            {
                var index = new InvalidMapReduceIndexWithTooManyOutputsPerDocument();
                index.Execute(store);

                PutDocuments(store);

                WaitForIndexing(store);

                var stats = store.DatabaseCommands.GetStatistics().Indexes.First(x => x.PublicName == index.IndexName);

                Assert.Equal(IndexingPriority.Error, stats.Priority);
            }
        }
예제 #2
0
        public void WhenIndexProducesTooManyOutputsPerDocumentItShouldError()
        {
            using (var store = NewDocumentStore())
            {
                var index = new InvalidMapReduceIndexWithTooManyOutputsPerDocument();
                index.Execute(store);

                PutDocuments(store);

                WaitForIndexing(store);

                var serverError = store.DatabaseCommands.GetStatistics().Errors.First();
                Assert.Equal(index.IndexName, serverError.IndexName);

                var queryResult = store.DatabaseCommands.Query(index.IndexName, new IndexQuery());
                Assert.NotEmpty(queryResult.Results);
            }
        }