From 2c5dab60b66e0e77f2a09ee7097ce39e1278f42d Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 27 Sep 2023 10:31:42 +0300 Subject: [PATCH] fix more warnings --- tests/NRedisStack.Tests/Examples/ExampleTests.cs | 2 +- tests/NRedisStack.Tests/Gears/GearsTests.cs | 2 +- tests/NRedisStack.Tests/Graph/GraphTests.cs | 2 +- tests/NRedisStack.Tests/Json/JsonTests.cs | 2 +- .../NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs | 1 + .../TimeSeries/TestAPI/TestDecrByAsync.cs | 8 +++++--- tests/NRedisStack.Tests/TimeSeries/TimeSeriesTests.cs | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/NRedisStack.Tests/Examples/ExampleTests.cs b/tests/NRedisStack.Tests/Examples/ExampleTests.cs index f788f4af..be3f2ca7 100644 --- a/tests/NRedisStack.Tests/Examples/ExampleTests.cs +++ b/tests/NRedisStack.Tests/Examples/ExampleTests.cs @@ -20,7 +20,7 @@ namespace NRedisStack.Tests; public class ExampleTests : AbstractNRedisStackTest, IDisposable { private readonly ITestOutputHelper testOutputHelper; - private readonly string key = "EXAMPLES_TESTS"; + // private readonly string key = "EXAMPLES_TESTS"; public ExampleTests(RedisFixture redisFixture, ITestOutputHelper testOutputHelper) : base(redisFixture) { this.testOutputHelper = testOutputHelper; diff --git a/tests/NRedisStack.Tests/Gears/GearsTests.cs b/tests/NRedisStack.Tests/Gears/GearsTests.cs index 16074dbf..e4c5e7bb 100644 --- a/tests/NRedisStack.Tests/Gears/GearsTests.cs +++ b/tests/NRedisStack.Tests/Gears/GearsTests.cs @@ -5,7 +5,7 @@ namespace NRedisStack.Tests.Gears; public class GearsTests : AbstractNRedisStackTest, IDisposable { - private readonly string key = "GEARS_TESTS"; + // private readonly string key = "GEARS_TESTS"; public GearsTests(RedisFixture redisFixture) : base(redisFixture) { } [SkipIfRedis(Comparison.LessThan, "7.1.242")] diff --git a/tests/NRedisStack.Tests/Graph/GraphTests.cs b/tests/NRedisStack.Tests/Graph/GraphTests.cs index b9dae8f7..10a6e6b3 100644 --- a/tests/NRedisStack.Tests/Graph/GraphTests.cs +++ b/tests/NRedisStack.Tests/Graph/GraphTests.cs @@ -8,7 +8,7 @@ namespace NRedisStack.Tests.Graph; public class GraphTests : AbstractNRedisStackTest, IDisposable { - private readonly string key = "GRAPH_TESTS"; + // private readonly string key = "GRAPH_TESTS"; public GraphTests(RedisFixture redisFixture) : base(redisFixture) { } #region SyncTests diff --git a/tests/NRedisStack.Tests/Json/JsonTests.cs b/tests/NRedisStack.Tests/Json/JsonTests.cs index 492acc12..36b8fa3a 100644 --- a/tests/NRedisStack.Tests/Json/JsonTests.cs +++ b/tests/NRedisStack.Tests/Json/JsonTests.cs @@ -9,7 +9,7 @@ namespace NRedisStack.Tests; public class JsonTests : AbstractNRedisStackTest, IDisposable { - private readonly string _testName = "JSON_TESTS"; + // private readonly string _testName = "JSON_TESTS"; public JsonTests(RedisFixture redisFixture) : base(redisFixture) { } [Fact] diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs index c7ec525d..d0a77c4b 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs @@ -90,6 +90,7 @@ public async Task TestAddWithLabels() } [Fact] + [Obsolete] public async Task TestAddWithChunkSize() { var key = CreateKeyName(); diff --git a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrByAsync.cs b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrByAsync.cs index 87a29974..463f69d6 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrByAsync.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrByAsync.cs @@ -51,6 +51,7 @@ public async Task TestDecrByTimeStamp() } [Fact] + [Obsolete] public async Task TestDefaultDecrByWithRetentionTime() { var key = CreateKeyName(); @@ -62,13 +63,14 @@ public async Task TestDefaultDecrByWithRetentionTime() Assert.True(await ts.DecrByAsync(key, -value, retentionTime: retentionTime) > 0); var result = await ts.GetAsync(key); - Assert.Equal(value, result.Val); + Assert.Equal(value, result!.Val); var info = await ts.InfoAsync(key); Assert.Equal(retentionTime, info.RetentionTime); } [Fact] + [Obsolete] public async Task TestDefaultDecrByWithLabels() { var key = CreateKeyName(); @@ -81,7 +83,7 @@ public async Task TestDefaultDecrByWithLabels() Assert.True(await ts.DecrByAsync(key, -value, labels: labels) > 0); var result = await ts.GetAsync(key); - Assert.Equal(value, result.Val); + Assert.Equal(value, result!.Val); var info = await ts.InfoAsync(key); Assert.Equal(labels, info.Labels); @@ -98,7 +100,7 @@ public async Task TestDefaultDecrByWithUncompressed() Assert.True(await ts.DecrByAsync(key, -value, uncompressed: true) > 0); var result = await ts.GetAsync(key); - Assert.Equal(value, result.Val); + Assert.Equal(value, result!.Val); } [Fact] diff --git a/tests/NRedisStack.Tests/TimeSeries/TimeSeriesTests.cs b/tests/NRedisStack.Tests/TimeSeries/TimeSeriesTests.cs index 6874fa83..cf7615a8 100644 --- a/tests/NRedisStack.Tests/TimeSeries/TimeSeriesTests.cs +++ b/tests/NRedisStack.Tests/TimeSeries/TimeSeriesTests.cs @@ -7,7 +7,7 @@ namespace NRedisStack.Tests.TimeSeries; public class TimeSeriesTests : AbstractNRedisStackTest, IDisposable { - private readonly string key = "TIME_SERIES_TESTS"; + // private readonly string key = "TIME_SERIES_TESTS"; public TimeSeriesTests(RedisFixture redisFixture) : base(redisFixture) { } // [Fact]