Skip to content

Instantly share code, notes, and snippets.

@e-tobi
Created July 11, 2013 13:06
Show Gist options
  • Save e-tobi/5975288 to your computer and use it in GitHub Desktop.
Save e-tobi/5975288 to your computer and use it in GitHub Desktop.
Failing RavenDB Test
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using Raven.Database.Extensions;
using Xunit;
namespace Raven.Tests.Bugs.Indexing
{
public class RestartingADocumentStore : RavenTest
{
public class Foo
{
public string Id { get; set; }
public string Name { get; set; }
}
[Fact]
public void ShouldNotIndexDocsWhichAreAlreadyIndexed()
{
IOExtensions.DeleteDirectory("Data");
using (var store = new EmbeddableDocumentStore())
{
store.Initialize();
new RavenDocumentsByEntityName().Execute(store);
using (var s = store.OpenSession())
{
for (int i = 0; i < 100; i++ ) s.Store(new Foo());
s.SaveChanges();
}
WaitForIndexing(store);
Assert.Empty(store.DocumentDatabase.Statistics.StaleIndexes);
}
using (var store = new EmbeddableDocumentStore())
{
store.Initialize();
Assert.Empty(store.DocumentDatabase.Statistics.StaleIndexes);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment