Commit 1cd9fcf5 authored by Alexey Zinoviev's avatar Alexey Zinoviev Committed by Nick Craver

Rider friendly solution. (#701)

GeoTests.cs converted to UTF-8, .idea dir added to .gitignore.
parent 219786ab
...@@ -16,6 +16,7 @@ Mono/ ...@@ -16,6 +16,7 @@ Mono/
RedisConfigs/*.dat RedisConfigs/*.dat
RedisQFork*.dat RedisQFork*.dat
StackExchange.Redis.*.zip StackExchange.Redis.*.zip
.idea/
.vs/ .vs/
*.lock.json *.lock.json
packages/ packages/
......
...@@ -39,8 +39,8 @@ public static GeoEntry ...@@ -39,8 +39,8 @@ public static GeoEntry
palermo = new GeoEntry(13.361389, 38.115556, "Palermo"), palermo = new GeoEntry(13.361389, 38.115556, "Palermo"),
catania = new GeoEntry(15.087269, 37.502669, "Catania"), catania = new GeoEntry(15.087269, 37.502669, "Catania"),
agrigento = new GeoEntry(13.5765, 37.311, "Agrigento"), agrigento = new GeoEntry(13.5765, 37.311, "Agrigento"),
cefal = new GeoEntry(14.0188, 38.0084, "Cefal"); cefalù = new GeoEntry(14.0188, 38.0084, "Cefalù");
public static GeoEntry[] all = { palermo, catania, agrigento, cefal }; public static GeoEntry[] all = { palermo, catania, agrigento, cefalù };
[AzureTest] [AzureTest]
public void GeoAdd() public void GeoAdd()
...@@ -52,12 +52,12 @@ public void GeoAdd() ...@@ -52,12 +52,12 @@ public void GeoAdd()
db.KeyDelete(key); db.KeyDelete(key);
// add while not there // add while not there
Assert.True(db.GeoAdd(key, cefal.Longitude, cefal.Latitude, cefal.Member)); Assert.True(db.GeoAdd(key, cefalù.Longitude, cefalù.Latitude, cefalù.Member));
Assert.Equal(2, db.GeoAdd(key, new GeoEntry[] { palermo, catania })); Assert.Equal(2, db.GeoAdd(key, new GeoEntry[] { palermo, catania }));
Assert.True(db.GeoAdd(key, agrigento)); Assert.True(db.GeoAdd(key, agrigento));
// now add again // now add again
Assert.False(db.GeoAdd(key, cefal.Longitude, cefal.Latitude, cefal.Member)); Assert.False(db.GeoAdd(key, cefalù.Longitude, cefalù.Latitude, cefalù.Member));
Assert.Equal(0, db.GeoAdd(key, new GeoEntry[] { palermo, catania })); Assert.Equal(0, db.GeoAdd(key, new GeoEntry[] { palermo, catania }));
Assert.False(db.GeoAdd(key, agrigento)); Assert.False(db.GeoAdd(key, agrigento));
} }
...@@ -158,13 +158,13 @@ public void GeoRadius() ...@@ -158,13 +158,13 @@ public void GeoRadius()
db.KeyDelete(key); db.KeyDelete(key);
db.GeoAdd(key, all); db.GeoAdd(key, all);
var results = db.GeoRadius(key, cefal.Member, 60, GeoUnit.Miles, 2, Order.Ascending); var results = db.GeoRadius(key, cefalù.Member, 60, GeoUnit.Miles, 2, Order.Ascending);
Assert.Equal(2, results.Length); Assert.Equal(2, results.Length);
Assert.Equal(results[0].Member, cefal.Member); Assert.Equal(results[0].Member, cefalù.Member);
Assert.Equal(0, results[0].Distance.Value); Assert.Equal(0, results[0].Distance.Value);
Assert.Equal(Math.Round(results[0].Position.Value.Longitude, 5), Math.Round(cefal.Position.Longitude, 5)); Assert.Equal(Math.Round(results[0].Position.Value.Longitude, 5), Math.Round(cefalù.Position.Longitude, 5));
Assert.Equal(Math.Round(results[0].Position.Value.Latitude, 5), Math.Round(cefal.Position.Latitude, 5)); Assert.Equal(Math.Round(results[0].Position.Value.Latitude, 5), Math.Round(cefalù.Position.Latitude, 5));
Assert.False(results[0].Hash.HasValue); Assert.False(results[0].Hash.HasValue);
Assert.Equal(results[1].Member, palermo.Member); Assert.Equal(results[1].Member, palermo.Member);
...@@ -173,9 +173,9 @@ public void GeoRadius() ...@@ -173,9 +173,9 @@ public void GeoRadius()
Assert.Equal(Math.Round(results[1].Position.Value.Latitude, 5), Math.Round(palermo.Position.Latitude, 5)); Assert.Equal(Math.Round(results[1].Position.Value.Latitude, 5), Math.Round(palermo.Position.Latitude, 5));
Assert.False(results[1].Hash.HasValue); Assert.False(results[1].Hash.HasValue);
results = db.GeoRadius(key, cefal.Member, 60, GeoUnit.Miles, 2, Order.Ascending, GeoRadiusOptions.None); results = db.GeoRadius(key, cefalù.Member, 60, GeoUnit.Miles, 2, Order.Ascending, GeoRadiusOptions.None);
Assert.Equal(2, results.Length); Assert.Equal(2, results.Length);
Assert.Equal(results[0].Member, cefal.Member); Assert.Equal(results[0].Member, cefalù.Member);
Assert.False(results[0].Position.HasValue); Assert.False(results[0].Position.HasValue);
Assert.False(results[0].Distance.HasValue); Assert.False(results[0].Distance.HasValue);
Assert.False(results[0].Hash.HasValue); Assert.False(results[0].Hash.HasValue);
......
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