Permalink
Browse files

Adding passing test for #401

  • Loading branch information...
1 parent 7d271c5 commit fee03d8dfc627fa4edf4a85b646875617e3ace13 @ayende ayende committed Nov 20, 2011
@@ -82,6 +82,7 @@
<Compile Include="Replication\ReplicationBase.cs" />
<Compile Include="Replication\SimpleReplication.cs" />
<Compile Include="Replication\WritesDuringFailover.cs" />
+ <Compile Include="Versioning\Bugs\MultipleVersions.cs" />
<Compile Include="Versioning\Bugs\VersioningWithGuidIds.cs" />
<Compile Include="Versioning\Versioning.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -0,0 +1,45 @@
+using Raven.Bundles.Versioning.Data;
+using Xunit;
+using Raven.Client.Versioning;
+
+namespace Raven.Bundles.Tests.Versioning.Bugs
+{
+ public class MultipleVersions : VersioningTest
+ {
+
+ [Fact]
+ public void Will_automatically_set_metadata()
+ {
+ using(var s = documentStore.OpenSession())
+ {
+ s.Store(new VersioningConfiguration
+ {
+ Exclude = false,
+ Id = "Raven/Versioning/DefaultConfiguration",
+ MaxRevisions = 50
+ });
+ s.SaveChanges();
+ }
+
+ for (int i = 0; i < 10; i++)
+ {
+ using (var session = documentStore.OpenSession())
+ {
+ session.Store(new Company
+ {
+ Name = "Company " + i,
+ Id = "companies/1"
+ });
+ session.SaveChanges();
+ }
+ }
+
+ using (var session = documentStore.OpenSession())
+ {
+ var company = session.Load<Company>("companies/1");
+ var companies = session.Advanced.GetRevisionsFor<Company>(company.Id, 0, 15);
+ Assert.Equal(10, companies.Length);
+ }
+ }
+ }
+}
@@ -212,7 +212,6 @@ public class User
public class Company
{
public string Name { get; set; }
-
public string Id { get; set; }
}
}

0 comments on commit fee03d8

Please sign in to comment.