Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/etishor/ravendb

Conflicts:
	Raven.Tests/Raven.Tests.csproj
  • Loading branch information...
commit d15520486ad61743f3230bec6e95b42384045950 2 parents 7ad8e63 + 271c803
@ayende ayende authored
View
56 Raven.Tests/Bugs/Iulian/GeneratesCorrectTemporaryIndex.cs
@@ -0,0 +1,56 @@
+
+namespace Raven.Tests.Bugs.Iulian
+{
+ using System.Linq;
+ using Xunit;
+
+ /// <summary>
+ /// Test that verifies that the generated index is correct.
+ /// The following index is generated:
+ /// Name: Temp/Outers/ByFlag
+ /// Map: from doc in docs.Outers select new { Flag = doc.Flag }
+ ///
+ /// The map part is wrong since the projection should be new { Flag = doc.Inner.Flag }
+ ///
+ /// </summary>
+ public class GeneratesCorrectTemporaryIndex : LocalClientTest
+ {
+ public class Inner
+ {
+ public bool Flag { get; set; }
+ }
+
+ public class Outer
+ {
+ public Inner Inner { get; set; }
+ }
+
+ [Fact]
+ public void Can_Generate_Correct_Temporary_Index()
+ {
+ using (var store = base.NewDocumentStore().Initialize())
+ {
+ using (var s = store.OpenSession())
+ {
+ // store the element
+ Outer outer = new Outer { Inner = new Inner { Flag = true } };
+ s.Store(outer);
+ s.SaveChanges();
+ }
+
+ using (var s = store.OpenSession())
+ {
+ // verify that the element is saved as expected ( this passes )
+ Outer test = s.Query<Outer>().SingleOrDefault();
+ Assert.NotNull(test);
+ Assert.True(test.Inner.Flag);
+
+ // query by the inner flag
+ Outer outer = s.Query<Outer>().Where(o => o.Inner.Flag).SingleOrDefault();
+
+ Assert.NotNull(outer); // this fails
+ }
+ }
+ }
+ }
+}
View
1  Raven.Tests/Raven.Tests.csproj
@@ -179,6 +179,7 @@
<Compile Include="Bugs\Indexing\InvalidIndexes.cs" />
<Compile Include="Bugs\Issue355.cs" />
<Compile Include="Bugs\LarsErik.cs" />
+ <Compile Include="Bugs\Iulian\GeneratesCorrectTemporaryIndex.cs" />
<Compile Include="Bugs\LiveProjections\Entities\Place.cs" />
<Compile Include="Bugs\LiveProjections\Entities\Task.cs" />
<Compile Include="Bugs\LiveProjections\Entities\TaskSummary.cs" />
View
7 repeated_run_of_bundles_test.ps1
@@ -0,0 +1,7 @@
+$i = 1
+while($true) {
+ echo "try #$i"
+ .\build\xunit.console.clr4.exe .\build\Raven.Bundles.Tests.dll
+ cls
+ $i = $i + 1
+}
Please sign in to comment.
Something went wrong with that request. Please try again.