Skip to content

Commit 919b7e2

Browse files
committed
fix format issues according to xunit 2.9.3
1 parent 27ee1ad commit 919b7e2

22 files changed

+81
-81
lines changed

tests/NRedisStack.Tests/Bloom/BloomTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public void TestInfo(string endpointId)
239239
var info = bf.Info(key);
240240

241241
Assert.NotNull(info);
242-
Assert.Equal(info.NumberOfItemsInserted, (long)1);
242+
Assert.Equal((long)1, info.NumberOfItemsInserted);
243243

244244
Assert.Throws<RedisServerException>(() => bf.Info("notExistKey"));
245245
}
@@ -255,7 +255,7 @@ public async Task TestInfoAsync(string endpointId)
255255
var info = await bf.InfoAsync(key);
256256

257257
Assert.NotNull(info);
258-
Assert.Equal(info.NumberOfItemsInserted, (long)1);
258+
Assert.Equal((long)1, info.NumberOfItemsInserted);
259259

260260
await Assert.ThrowsAsync<RedisServerException>(() => bf.InfoAsync("notExistKey"));
261261
}

tests/NRedisStack.Tests/CuckooFilter/CuckooTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ public void TestInfo(string endpointId)
192192
var info = cf.Info(key);
193193

194194
Assert.NotNull(info);
195-
Assert.Equal(info.BucketSize, (long)2);
196-
Assert.Equal(info.ExpansionRate, (long)1);
197-
Assert.Equal(info.MaxIterations, (long)20);
198-
Assert.Equal(info.NumberOfBuckets, (long)512);
199-
Assert.Equal(info.NumberOfFilters, (long)1);
200-
Assert.Equal(info.NumberOfItemsDeleted, (long)0);
201-
Assert.Equal(info.NumberOfItemsInserted, (long)1);
202-
Assert.Equal(info.Size, (long)1080);
195+
Assert.Equal((long)2, info.BucketSize);
196+
Assert.Equal((long)1, info.ExpansionRate);
197+
Assert.Equal((long)20, info.MaxIterations);
198+
Assert.Equal((long)512, info.NumberOfBuckets);
199+
Assert.Equal((long)1, info.NumberOfFilters);
200+
Assert.Equal((long)0, info.NumberOfItemsDeleted);
201+
Assert.Equal((long)1, info.NumberOfItemsInserted);
202+
Assert.Equal((long)1080, info.Size);
203203

204204
Assert.Throws<RedisServerException>(() => cf.Info("notExistKey"));
205205
}
@@ -215,14 +215,14 @@ public async Task TestInfoAsync(string endpointId)
215215
var info = await cf.InfoAsync(key);
216216

217217
Assert.NotNull(info);
218-
Assert.Equal(info.BucketSize, (long)2);
219-
Assert.Equal(info.ExpansionRate, (long)1);
220-
Assert.Equal(info.MaxIterations, (long)20);
221-
Assert.Equal(info.NumberOfBuckets, (long)512);
222-
Assert.Equal(info.NumberOfFilters, (long)1);
223-
Assert.Equal(info.NumberOfItemsDeleted, (long)0);
224-
Assert.Equal(info.NumberOfItemsInserted, (long)1);
225-
Assert.Equal(info.Size, (long)1080);
218+
Assert.Equal((long)2, info.BucketSize);
219+
Assert.Equal((long)1, info.ExpansionRate);
220+
Assert.Equal((long)20, info.MaxIterations);
221+
Assert.Equal((long)512, info.NumberOfBuckets);
222+
Assert.Equal((long)1, info.NumberOfFilters);
223+
Assert.Equal((long)0, info.NumberOfItemsDeleted);
224+
Assert.Equal((long)1, info.NumberOfItemsInserted);
225+
Assert.Equal((long)1080, info.Size);
226226

227227

228228

tests/NRedisStack.Tests/Examples/ExampleTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public async Task PipelineWithAsync(string endpointId)
225225
selectedLabels: new List<string> { "location" });
226226

227227
// Assert the response
228-
Assert.Equal(1, response.Count);
228+
Assert.Single(response);
229229
Assert.Equal("temp:JLM", response[0].key);
230230
}
231231

tests/NRedisStack.Tests/Json/JsonTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ public void TestMultiPathGet(string endpointId)
990990
}
991991
else
992992
{
993-
Assert.True(false, "$..a was not a json array");
993+
Assert.Fail("$..a was not a json array");
994994
}
995995

996996
Assert.True(obj["$.b"]![0]!["a"]!.ToString() == "world");
@@ -1015,7 +1015,7 @@ public async Task TestMultiPathGetAsync(string endpointId)
10151015
}
10161016
else
10171017
{
1018-
Assert.True(false, "$..a was not a json array");
1018+
Assert.Fail("$..a was not a json array");
10191019
}
10201020

10211021
Assert.True(obj["$.b"]![0]!["a"]!.ToString() == "world");

tests/NRedisStack.Tests/Search/SearchTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ public void TestLimit(string endpointId)
21702170
var req = new AggregationRequest("*").SortBy("@t1").Limit(1);
21712171
var res = ft.Aggregate("idx", req);
21722172

2173-
Assert.Equal(1, res.GetResults().Count);
2173+
Assert.Single(res.GetResults());
21742174
Assert.Equal("a", res.GetResults()[0]["t1"].ToString());
21752175
}
21762176

@@ -2190,7 +2190,7 @@ public async Task TestLimitAsync(string endpointId)
21902190
var req = new AggregationRequest("*").SortBy("@t1").Limit(1, 1);
21912191
var res = await ft.AggregateAsync("idx", req);
21922192

2193-
Assert.Equal(1, res.GetResults().Count);
2193+
Assert.Single(res.GetResults());
21942194
Assert.Equal("b", res.GetResults()[0]["t1"].ToString());
21952195
}
21962196

tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAdd.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ public void TestAddAndIgnoreValues(string endpointId)
228228
RedisResult info = TimeSeriesHelper.getInfo(db, key, out j, out k);
229229
Assert.NotNull(info);
230230
Assert.True(info.Length > 0);
231-
Assert.NotEqual(j, -1);
232-
Assert.NotEqual(k, -1);
231+
Assert.NotEqual(-1, j);
232+
Assert.NotEqual(-1, k);
233233
Assert.Equal(15, (long)info[j + 1]);
234234
Assert.Equal(16, (long)info[k + 1]);
235235
}

tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAlter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public void TestAlterAndIgnoreValues(string endpointId)
7373
RedisResult info = TimeSeriesHelper.getInfo(db, key, out j, out k);
7474
Assert.NotNull(info);
7575
Assert.True(info.Length > 0);
76-
Assert.NotEqual(j, -1);
77-
Assert.NotEqual(k, -1);
76+
Assert.NotEqual(-1, j);
77+
Assert.NotEqual(-1, k);
7878
Assert.Equal(13, (long)info[j + 1]);
7979
Assert.Equal(14, (long)info[k + 1]);
8080
}

tests/NRedisStack.Tests/TimeSeries/TestAPI/TestCreate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public void TestCreateAndIgnoreValues(string endpointId)
122122
int j = -1, k = -1;
123123
RedisResult info = TimeSeriesHelper.getInfo(db, key, out j, out k);
124124

125-
Assert.NotEqual(j, -1);
126-
Assert.NotEqual(k, -1);
125+
Assert.NotEqual(-1, j);
126+
Assert.NotEqual(-1, k);
127127
Assert.Equal(11, (long)info[j + 1]);
128128
Assert.Equal(12, (long)info[k + 1]);
129129
}

tests/NRedisStack.Tests/TimeSeries/TestAPI/TestCreateAsync.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public async Task TestCreateUncompressed()
7171
}
7272

7373
[Fact]
74-
public async void TestCreatehDuplicatePolicyFirst()
74+
public async Task TestCreatehDuplicatePolicyFirst()
7575
{
7676
var key = CreateKeyName();
7777
var db = GetCleanDatabase();
@@ -80,7 +80,7 @@ public async void TestCreatehDuplicatePolicyFirst()
8080
}
8181

8282
[Fact]
83-
public async void TestCreatehDuplicatePolicyLast()
83+
public async Task TestCreatehDuplicatePolicyLast()
8484
{
8585
var key = CreateKeyName();
8686
var db = GetCleanDatabase();
@@ -89,7 +89,7 @@ public async void TestCreatehDuplicatePolicyLast()
8989
}
9090

9191
[Fact]
92-
public async void TestCreatehDuplicatePolicyMin()
92+
public async Task TestCreatehDuplicatePolicyMin()
9393
{
9494
var key = CreateKeyName();
9595
var db = GetCleanDatabase();
@@ -98,7 +98,7 @@ public async void TestCreatehDuplicatePolicyMin()
9898
}
9999

100100
[Fact]
101-
public async void TestCreatehDuplicatePolicyMax()
101+
public async Task TestCreatehDuplicatePolicyMax()
102102
{
103103
var key = CreateKeyName();
104104
var db = GetCleanDatabase();
@@ -107,7 +107,7 @@ public async void TestCreatehDuplicatePolicyMax()
107107
}
108108

109109
[Fact]
110-
public async void TestCreatehDuplicatePolicySum()
110+
public async Task TestCreatehDuplicatePolicySum()
111111
{
112112
var key = CreateKeyName();
113113
var db = GetCleanDatabase();

tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrBy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public async void TestIncrDecryByAndIgnoreValues(string endpointId)
109109
RedisResult info = TimeSeriesHelper.getInfo(db, key, out j, out k);
110110
Assert.NotNull(info);
111111
Assert.True(info.Length > 0);
112-
Assert.NotEqual(j, -1);
113-
Assert.NotEqual(k, -1);
112+
Assert.NotEqual(-1, j);
113+
Assert.NotEqual(-1, k);
114114
Assert.Equal(15, (long)info[j + 1]);
115115
Assert.Equal(16, (long)info[k + 1]);
116116
}

0 commit comments

Comments
 (0)