Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
1cd9fcf5
Commit
1cd9fcf5
authored
Aug 31, 2017
by
Alexey Zinoviev
Committed by
Nick Craver
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rider friendly solution. (#701)
GeoTests.cs converted to UTF-8, .idea dir added to .gitignore.
parent
219786ab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
.gitignore
.gitignore
+1
-0
GeoTests.cs
StackExchange.Redis.Tests/GeoTests.cs
+10
-10
No files found.
.gitignore
View file @
1cd9fcf5
...
@@ -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/
...
...
StackExchange.Redis.Tests/GeoTests.cs
View file @
1cd9fcf5
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment