Skip to content

Commit 4316ed2

Browse files
committed
Fixed remaining warnings
1 parent e99648b commit 4316ed2

16 files changed

Lines changed: 31 additions & 27 deletions

File tree

src/EventLogExpert.Eventing.Tests/Providers/ProviderMetadataTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task Channels_WhenAccessedConcurrently_ShouldReturnValidData()
3232
// Assert
3333
var results = tasks.Select(t => t.Result).ToList();
3434
Assert.All(results, Assert.NotNull);
35-
Assert.All(results, Assert.NotEmpty);
35+
Assert.All(results, r => Assert.NotEmpty(r!));
3636
}
3737

3838
[Fact]
@@ -598,8 +598,8 @@ public async Task Opcodes_WhenAccessedConcurrently_ShouldReturnValidData()
598598

599599
// Assert
600600
var results = tasks.Select(t => t.Result).ToList();
601-
Assert.All(results, r => Assert.NotNull(r));
602-
Assert.All(results, r => Assert.NotEmpty(r));
601+
Assert.All(results, Assert.NotNull);
602+
Assert.All(results, r => Assert.NotEmpty(r!));
603603
}
604604

605605
[Fact]
@@ -741,8 +741,8 @@ public async Task Tasks_WhenAccessedConcurrently_ShouldReturnValidData()
741741

742742
// Assert
743743
var results = tasks.Select(t => t.Result).ToList();
744-
Assert.All(results, r => Assert.NotNull(r));
745-
Assert.All(results, r => Assert.NotEmpty(r));
744+
Assert.All(results, Assert.NotNull);
745+
Assert.All(results, r => Assert.NotEmpty(r!));
746746
}
747747

748748
[Fact]

src/EventLogExpert.Eventing.Tests/Readers/EventLogReaderTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// // Licensed under the MIT License.
33

44
using EventLogExpert.Eventing.Helpers;
5-
using EventLogExpert.Eventing.Models;
65
using EventLogExpert.Eventing.Readers;
76
using EventLogExpert.Eventing.Tests.TestUtils.Constants;
87

@@ -608,12 +607,12 @@ public void TryGetEvents_WhenRenderXmlTrue_XmlShouldBeValidFormat()
608607
// Assert
609608
Assert.True(success);
610609

611-
if (events.Length > 0 && !string.IsNullOrEmpty(events[0].Xml))
610+
if (events.Length > 0 && events[0].Xml is { } xml && !string.IsNullOrEmpty(xml))
612611
{
613612
// XML should start with <?xml or <Event
614613
Assert.True(
615-
events[0].Xml.StartsWith("<?xml") || events[0].Xml.StartsWith("<Event"),
616-
$"Expected XML to start with '<?xml' or '<Event', but got: {events[0].Xml[..Math.Min(50, events[0].Xml.Length)]}");
614+
xml.StartsWith("<?xml") || xml.StartsWith("<Event"),
615+
$"Expected XML to start with '<?xml' or '<Event', but got: {xml[..Math.Min(50, xml.Length)]}");
617616
}
618617
}
619618

src/EventLogExpert.Eventing.Tests/Readers/EventLogWatcherTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public void EventRecordWritten_ShouldHaveValidTimeCreated()
451451
// Assert
452452
Assert.True(received, "Did not receive event within timeout period");
453453
Assert.NotNull(capturedEvent);
454-
Assert.NotNull(capturedEvent.TimeCreated);
454+
Assert.NotEqual(default(DateTime), capturedEvent.TimeCreated);
455455
Assert.True(capturedEvent.TimeCreated >= beforeWrite.AddSeconds(-1));
456456
Assert.True(capturedEvent.TimeCreated <= afterWrite);
457457
}

src/EventLogExpert.UI.Tests/Store/EventLogEffectsTests.cs renamed to src/EventLogExpert.UI.Tests/Store/EventLog/EventLogEffectsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using NSubstitute;
1818
using System.Collections.Immutable;
1919

20-
namespace EventLogExpert.UI.Tests.Store;
20+
namespace EventLogExpert.UI.Tests.Store.EventLog;
2121

2222
public sealed class EventLogEffectsTests
2323
{

src/EventLogExpert.UI.Tests/Store/EventLogStoreTests.cs renamed to src/EventLogExpert.UI.Tests/Store/EventLog/EventLogStoreTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using EventLogExpert.UI.Tests.TestUtils.Constants;
1010
using System.Collections.Immutable;
1111

12-
namespace EventLogExpert.UI.Tests.Store;
12+
namespace EventLogExpert.UI.Tests.Store.EventLog;
1313

1414
public sealed class EventLogStoreTests
1515
{

src/EventLogExpert.UI.Tests/Store/EventTableEffectsTests.cs renamed to src/EventLogExpert.UI.Tests/Store/EventTable/EventTableEffectsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Fluxor;
77
using NSubstitute;
88

9-
namespace EventLogExpert.UI.Tests.Store;
9+
namespace EventLogExpert.UI.Tests.Store.EventTable;
1010

1111
public sealed class EventTableEffectsTests
1212
{

src/EventLogExpert.UI.Tests/Store/EventTableStoreTests.cs renamed to src/EventLogExpert.UI.Tests/Store/EventTable/EventTableStoreTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using EventLogExpert.UI.Tests.TestUtils;
99
using EventLogExpert.UI.Tests.TestUtils.Constants;
1010

11-
namespace EventLogExpert.UI.Tests.Store;
11+
namespace EventLogExpert.UI.Tests.Store.EventTable;
1212

1313
public sealed class EventTableStoreTests
1414
{

src/EventLogExpert.UI.Tests/Store/FilterCacheEffectsTests.cs renamed to src/EventLogExpert.UI.Tests/Store/FilterCache/FilterCacheEffectsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using NSubstitute;
99
using System.Collections.Immutable;
1010

11-
namespace EventLogExpert.UI.Tests.Store;
11+
namespace EventLogExpert.UI.Tests.Store.FilterCache;
1212

1313
public sealed class FilterCacheEffectsTests
1414
{

src/EventLogExpert.UI.Tests/Store/FilterCacheStoreTests.cs renamed to src/EventLogExpert.UI.Tests/Store/FilterCache/FilterCacheStoreTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using EventLogExpert.UI.Tests.TestUtils.Constants;
66
using System.Collections.Immutable;
77

8-
namespace EventLogExpert.UI.Tests.Store;
8+
namespace EventLogExpert.UI.Tests.Store.FilterCache;
99

1010
public sealed class FilterCacheStoreTests
1111
{

src/EventLogExpert.UI.Tests/Store/FilterGroupEffectsTests.cs renamed to src/EventLogExpert.UI.Tests/Store/FilterGroup/FilterGroupEffectsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using NSubstitute;
1010
using System.Collections.Immutable;
1111

12-
namespace EventLogExpert.UI.Tests.Store;
12+
namespace EventLogExpert.UI.Tests.Store.FilterGroup;
1313

1414
public sealed class FilterGroupEffectsTests
1515
{

0 commit comments

Comments
 (0)