Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More error handling tests

  • Loading branch information...
commit 3ac0b0b48c027dc1f086cb02deaec566bfc10e0e 1 parent f60b8f4
@ayende ayende authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 Raven.Tests/Bugs/MultiMap/Errors.cs
View
27 Raven.Tests/Bugs/MultiMap/Errors.cs
@@ -29,6 +29,33 @@ public void MultiMapsMustHaveSameOutput()
Missing fields : Username
Additional fields : Title", exception.Message);
}
+
+ }
+
+ [Fact]
+ public void MultiMapsMustHaveSameOutputAsReduce()
+ {
+ using (var store = NewDocumentStore())
+ {
+ var exception = Assert.Throws<InvalidOperationException>(() => store.DatabaseCommands.PutIndex("test",
+ new IndexDefinition
+ {
+ Maps =
+ {
+ "from user in docs.Users select new { user.Title }",
+ "from post in docs.Posts select new { post.Title }"
+ },
+ Reduce = "from result in results group result by result.Title into g select new { Title = g.Key, Count = g.Count() }"
+ }));
+
+ Assert.Equal(
+ @"The result type is not consistent across map and reduce:
+Common fields: Title
+Map only fields :
+Reduce only fields: Count
+",
+ exception.Message);
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.