Skip to content

Commit 964aeae

Browse files
authored
Add More Coverage (#54)
* Add FTCreateParams coverage * chagne payload to string * Add cover to graph delete * cover test info * add test to cover load and load all * comment SortByAsc SortByDesc * comment AggregationRequest SerializeRedisArgs * Add test to cover numeric and geo filters * Add test to cover schema Fields * revert * Add test to cover Equals methods in graph * fix alterAdd test * add info to TopK test * local codecov * comment ToHashEntry * Change AlterAdd test * Cover CF.INFO fields * Cover TDigest.INFO fields * comment ToFtInfoAsDictionary * add cover to ArrPopAsync * Add cover to json get command
1 parent 89b59ce commit 964aeae

27 files changed

+671
-203
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,7 @@ FodyWeavers.xsd
396396

397397
# JetBrains Rider
398398
*.sln.iml
399-
.idea
399+
.idea
400+
tests/NRedisStack.Tests/lcov.net7.0.info
401+
tests/NRedisStack.Tests/lcov.net6.0.info
402+
tests/NRedisStack.Tests/lcov.info

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
{
2+
"dotnet-test-explorer.testArguments": "/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info",
3+
"dotnet-test-explorer.testProjectPath": "**/*NRedisStack.Tests.csproj"
24
}

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@
3636
"${workspaceFolder}/tests/NRedisStack.Tests/NRedisStack.Tests.csproj"
3737
],
3838
"problemMatcher": "$msCompile"
39+
},
40+
{
41+
"label": "test",
42+
"dependsOn": [],
43+
"command": "dotnet",
44+
"type": "process",
45+
"args": [
46+
"test",
47+
"${workspaceFolder}/tests/NRedisStack.Tests/NRedisStack.Tests.csproj",
48+
"/p:CollectCoverage=true",
49+
"/p:CoverletOutputFormat=lcov",
50+
"/p:CoverletOutput=./lcov.info"
51+
],
52+
"problemMatcher": "$msCompile",
53+
"group": {
54+
"kind": "test",
55+
"isDefault": true
56+
}
3957
}
4058
]
4159
}

src/NRedisStack/CuckooFilter/DataTypes/CuckooInformation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ public class CuckooInformation
88
{
99
public long Size { get; private set; }
1010
public long NumberOfBuckets { get; private set; }
11-
public long NumberOfFilter { get; private set; }
11+
public long NumberOfFilters { get; private set; }
1212
public long NumberOfItemsInserted { get; private set; }
1313
public long NumberOfItemsDeleted { get; private set; }
1414
public long BucketSize { get; private set; }
1515
public long ExpansionRate { get; private set; }
16-
public long MaxIteration { get; private set; }
16+
public long MaxIterations { get; private set; }
1717

1818
internal CuckooInformation(long size, long numberOfBuckets, long numberOfFilter,
1919
long numberOfItemsInserted, long numberOfItemsDeleted,
2020
long bucketSize, long expansionRate, long maxIteration)
2121
{
2222
Size = size;
2323
NumberOfBuckets = numberOfBuckets;
24-
NumberOfFilter = numberOfFilter;
24+
NumberOfFilters = numberOfFilter;
2525
NumberOfItemsInserted = numberOfItemsInserted;
2626
NumberOfItemsDeleted = numberOfItemsDeleted;
2727
BucketSize = bucketSize;
2828
ExpansionRate = expansionRate;
29-
MaxIteration = maxIteration;
29+
MaxIterations = maxIteration;
3030
}
3131
}
3232
}

src/NRedisStack/Graph/DataTypes/Edge.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class Edge : GraphEntity
2626
/// <value></value>
2727
public long Destination { get; set; }
2828

29+
// TODO: check if this is needed:
2930
/// <summary>
3031
/// Overriden from the base `Equals` implementation. In addition to the expected behavior of checking
3132
/// reference equality, we'll also fall back and check to see if the: Source, Destination, and RelationshipType

src/NRedisStack/Graph/DataTypes/GraphEntity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public abstract class GraphEntity
1212

1313
public IDictionary<string, object> PropertyMap = new Dictionary<string, object>();
1414

15+
// TODO: check if this is needed:
1516
/// <summary>
1617
/// Overriden Equals that considers the equality of the entity ID as well as the equality of the
1718
/// properties that each entity has.

src/NRedisStack/Graph/DataTypes/Node.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public Node()
1616
Labels = new List<string>();
1717
}
1818

19+
// TODO: check if this is needed:
1920
/// <summary>
2021
/// Overriden member that checks to see if the names of the labels of a node are equal
2122
/// (in addition to base `Equals` functionality).

src/NRedisStack/Graph/DataTypes/Path.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ public Path(IList<Node> nodes, IList<Edge> edges)
2020
Edges = new ReadOnlyCollection<Edge>(edges);
2121
}
2222

23-
24-
/// <summary>
25-
/// How many edges exist on this path.
26-
/// </summary>
27-
public int Length => Edges.Count;
28-
23+
// TODO: check if this is needed:
2924
/// <summary>
3025
/// Overriden `Equals` method that will consider the equality of the Nodes and Edges between two paths.
3126
/// </summary>
@@ -73,6 +68,7 @@ public override int GetHashCode()
7368
}
7469
}
7570

71+
// TODO: check if this is needed:
7672
/// <summary>
7773
/// Overridden `ToString` method that will emit a string based on the string values of the nodes and edges
7874
/// on the path.

src/NRedisStack/Graph/GraphCommandBuilder.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ public static class GraphCommandBuilder
88
{
99
internal static readonly object CompactQueryFlag = "--COMPACT";
1010

11-
/// <inheritdoc/>
12-
public static SerializedCommand Query(string graphName, string query, IDictionary<string, object> parameters, long? timeout = null)
13-
{
14-
var preparedQuery = PrepareQuery(query, parameters);
15-
16-
return Query(graphName, preparedQuery, timeout);
17-
}
18-
1911
/// <inheritdoc/>
2012
public static SerializedCommand Query(string graphName, string query, long? timeout = null)
2113
{
@@ -25,14 +17,6 @@ public static SerializedCommand Query(string graphName, string query, long? time
2517
return new SerializedCommand(GRAPH.QUERY, args);
2618
}
2719

28-
/// <inheritdoc/>
29-
public static SerializedCommand RO_Query(string graphName, string query, IDictionary<string, object> parameters, long? timeout = null)
30-
{
31-
var preparedQuery = PrepareQuery(query, parameters);
32-
33-
return RO_Query(graphName, preparedQuery, timeout);
34-
}
35-
3620
/// <inheritdoc/>
3721
public static SerializedCommand RO_Query(string graphName, string query, long? timeout = null)
3822
{

src/NRedisStack/Graph/GraphCommands.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ public GraphCommands(IDatabase db)
1818

1919
private readonly IDictionary<string, GraphCache> _graphCaches = new Dictionary<string, GraphCache>();
2020

21-
private GraphCache GetGraphCache(string graphName)
22-
{
23-
if (!_graphCaches.ContainsKey(graphName))
24-
{
25-
_graphCaches.Add(graphName, new GraphCache(graphName, this));
26-
}
27-
28-
return _graphCaches[graphName];
29-
}
30-
3121
/// <inheritdoc/>
3222
public ResultSet Query(string graphName, string query, IDictionary<string, object> parameters, long? timeout = null)
3323
{

0 commit comments

Comments
 (0)