Skip to content

Commit

Permalink
Fixing issues because of moving to separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
ayende committed Oct 11, 2010
1 parent e638053 commit 292b235
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions Raven.Tests/Indexes/MapOnlyView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel;
using System.Linq;
using Raven.Database.Linq;

namespace Raven.Tests.Indexes
Expand Down
8 changes: 4 additions & 4 deletions Raven.Tests/Indexes/ShoppingCartEventsToShopingCart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ public class ShoppingCartEventsToShopingCart : AbstractViewGenerator
{
public ShoppingCartEventsToShopingCart()
{
MapDefinition = docs => docs.Where<object>(document => document.For == "ShoppingCart");
MapDefinition = docs => docs.Where(document => document.For == "ShoppingCart");
GroupByExtraction = source => source.ShoppingCartId;
ReduceDefinition = Reduce;

Indexes.Add("Id", FieldIndexing.NotAnalyzed);
Indexes.Add("Aggregate", FieldIndexing.No);
}

private static IEnumerable<object> Reduce(IEnumerable<object> source)
private static IEnumerable<object> Reduce(IEnumerable<dynamic> source)
{
foreach (var events in source
.GroupBy<object, object>(@event => @event.ShoppingCartId))
.GroupBy(@event => @event.ShoppingCartId))
{
var cart = new ShoppingCart { Id = events.Key };
foreach (var @event in events.OrderBy<object, object>(x => x.Timestamp))
foreach (var @event in events.OrderBy(x => x.Timestamp))
{
switch ((string)@event.Type)
{
Expand Down
1 change: 1 addition & 0 deletions Raven.Tests/Raven.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
</Compile>
<Compile Include="Queries\DyanmicQueries.cs" />
<Compile Include="Queries\ParameterisedDynamicQuery.cs" />
<Compile Include="Spatial\Event.cs" />
<Compile Include="Spatial\SpatialIndex.cs" />
<Compile Include="Indexes\Statistics.cs" />
<Compile Include="Indexes\UsingQueryBuilder.cs" />
Expand Down
18 changes: 18 additions & 0 deletions Raven.Tests/Spatial/Event.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Raven.Tests.Spatial
{
public class Event
{
public Event() { }

public Event(string venue, double lat, double lng)
{
this.Venue = venue;
this.Latitude = lat;
this.Longitude = lng;
}

public string Venue { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
}
4 changes: 0 additions & 4 deletions Raven.Tests/Spatial/SpatialIndexTestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Raven.Database;
using Raven.Database.Data;
using Raven.Database.Indexing;
using Raven.Database.Json;

Expand Down

0 comments on commit 292b235

Please sign in to comment.