Commit 24a92a21 authored by Nick Craver's avatar Nick Craver

Revert bad changes from #694

This was correct before, not sure how we convinced ourselves otherwise. I added additional verification checks to the tests.
parent de7da51a
......@@ -34,6 +34,12 @@ public void GeoAdd()
Assert.False(db.GeoAdd(key, cefalù.Longitude, cefalù.Latitude, cefalù.Member));
Assert.Equal(0, db.GeoAdd(key, new GeoEntry[] { palermo, catania }));
Assert.False(db.GeoAdd(key, agrigento));
// Validate
var pos = db.GeoPosition(key, palermo.Member);
Assert.NotNull(pos);
Assert.Equal(palermo.Longitude, pos.Value.Longitude, 5);
Assert.Equal(palermo.Latitude, pos.Value.Latitude, 5);
}
}
......
......@@ -282,7 +282,7 @@ internal string[] GetItemsAsStrings()
{
return null;
}
return new GeoPosition((double)coords[1].AsRedisValue(), (double)coords[0].AsRedisValue());
return new GeoPosition((double)coords[0].AsRedisValue(), (double)coords[1].AsRedisValue());
}
internal GeoPosition?[] GetItemsAsGeoPositionArray()
......@@ -308,7 +308,7 @@ internal string[] GetItemsAsStrings()
}
else
{
arr[i] = new GeoPosition((double)item[1].AsRedisValue(), (double)item[0].AsRedisValue());
arr[i] = new GeoPosition((double)item[0].AsRedisValue(), (double)item[1].AsRedisValue());
}
}
return arr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment