Browse files

Adding passing test

  • Loading branch information...
1 parent 35ca35e commit bd561d8551dfc29689492d2fc06a611e4b988beb @ayende ayende committed Jul 4, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 Raven.Tests/Shard/When_Using_Sharded_Servers.cs
View
24 Raven.Tests/Shard/When_Using_Sharded_Servers.cs
@@ -73,6 +73,30 @@ public When_Using_Sharded_Servers()
IShardResolutionStrategy shardResolution;
IShardStrategy shardStrategy;
+ [Fact]
+ public void Can_override_the_shard_id_generation()
+ {
+ using (var documentStore = new ShardedDocumentStore(shardStrategy, shards))
+ {
+ documentStore.Initialize();
+
+ foreach (var shard in shards)
+ {
+ var s = shard;
+ shard.Conventions.DocumentKeyGenerator = c => ((Company) c).Name;
+ }
+
+ using (var session = documentStore.OpenSession())
+ {
+ session.Store(company1);
+ session.Store(company2);
+
+ Assert.Equal("Company1", company1.Id);
+ Assert.Equal("Company2", company2.Id);
+ }
+ }
+ }
+
[Fact]
public void Can_insert_into_two_sharded_servers()
{

0 comments on commit bd561d8

Please sign in to comment.