diff --git a/src/Core/Geofence/GeofenceService.cs b/src/Core/Geofence/GeofenceService.cs index 37267b009..c5c6ab4f7 100644 --- a/src/Core/Geofence/GeofenceService.cs +++ b/src/Core/Geofence/GeofenceService.cs @@ -9,7 +9,7 @@ namespace Rocket.Surgery.Airframe /// public class GeofenceService : IGeofenceService, IGeofenceStore { - private SourceCache _store = new SourceCache(x => x.Identifier); + private readonly SourceCache _store = new SourceCache(region => region.Identifier); /// public IObservable Location { get; } diff --git a/test/Data.Tests/DuckGo/DuckDuckGoFunctionTests.cs b/test/Data.Tests/DuckGo/DuckDuckGoFunctionTests.cs index 131967906..5f9f6f9b2 100644 --- a/test/Data.Tests/DuckGo/DuckDuckGoFunctionTests.cs +++ b/test/Data.Tests/DuckGo/DuckDuckGoFunctionTests.cs @@ -6,7 +6,7 @@ using System.Reactive.Linq; using Xunit; -namespace Airframe.Data.Tests.DuckGo +namespace Rocket.Surgery.Airframe.Data.Tests.DuckGo { public class DuckDuckGoFunctionTests { @@ -14,10 +14,11 @@ public class DuckDuckGoFunctionTests public void Should_Return_ChangeSet() { // Given - var sourceCache = new SourceCache(x => x.FirstUrl); + using var sourceCache = new SourceCache(topic => topic.FirstUrl); // When - Observable.Return( + using var disposable = + Observable.Return( new List { new() @@ -26,8 +27,7 @@ public void Should_Return_ChangeSet() Result = "result", Text = "text", }, - } - ) + }) .Cache(sourceCache, true) .Bind(out var result) .Subscribe(); @@ -42,7 +42,7 @@ public void Should_Return_ChangeSet() public void Should_Return_Cached() { // Given - var sourceCache = new SourceCache(x => x.FirstUrl); + using var sourceCache = new SourceCache(topic => topic.FirstUrl); var firstResultGuid = Guid.NewGuid().ToString(); sourceCache.AddOrUpdate( new RelatedTopic @@ -50,11 +50,11 @@ public void Should_Return_Cached() FirstUrl = firstResultGuid, Result = "result one", Text = "text", - } - ); + }); // When - Observable.Return( + using var disposable = + Observable.Return( new List { new() @@ -69,8 +69,7 @@ public void Should_Return_Cached() Result = "result two", Text = "text", }, - } - ) + }) .Cache(sourceCache, true) .Bind(out var result) .Subscribe(); @@ -85,7 +84,7 @@ public void Should_Return_Cached() public void Should_Clear_Cached() { // Given - var sourceCache = new SourceCache(x => x.FirstUrl); + using var sourceCache = new SourceCache(topic => topic.FirstUrl); sourceCache.AddOrUpdate( new RelatedTopic { @@ -95,7 +94,8 @@ public void Should_Clear_Cached() }); // When - Observable.Return( + using var disposable = + Observable.Return( new List { new() @@ -104,8 +104,7 @@ public void Should_Clear_Cached() Result = "result two", Text = "text", }, - } - ) + }) .Cache(sourceCache, true) .Bind(out var result) .Subscribe(); @@ -113,7 +112,7 @@ public void Should_Clear_Cached() // Then result .Should() - .ContainSingle(x => x.Result == "result two"); + .ContainSingle(topic => topic.Result == "result two"); } } } \ No newline at end of file diff --git a/test/Data.Tests/DuckGo/DuckDuckGoServiceFixture.cs b/test/Data.Tests/DuckGo/DuckDuckGoServiceFixture.cs index 4bb8823ec..75141dc61 100644 --- a/test/Data.Tests/DuckGo/DuckDuckGoServiceFixture.cs +++ b/test/Data.Tests/DuckGo/DuckDuckGoServiceFixture.cs @@ -2,7 +2,7 @@ using Rocket.Surgery.Airframe.Data.DuckDuckGo; using Rocket.Surgery.Extensions.Testing.Fixtures; -namespace Airframe.Data.Tests.DuckGo +namespace Rocket.Surgery.Airframe.Data.Tests.DuckGo { internal class DuckDuckGoServiceFixture : ITestFixtureBuilder { diff --git a/test/Data.Tests/DuckGo/DuckDuckGoServiceTests.cs b/test/Data.Tests/DuckGo/DuckDuckGoServiceTests.cs index 6ce2b3cd3..08aacffd5 100644 --- a/test/Data.Tests/DuckGo/DuckDuckGoServiceTests.cs +++ b/test/Data.Tests/DuckGo/DuckDuckGoServiceTests.cs @@ -7,7 +7,7 @@ using System.Reactive.Linq; using Xunit; -namespace Airframe.Data.Tests.DuckGo +namespace Rocket.Surgery.Airframe.Data.Tests.DuckGo { public class DuckDuckGoServiceTests { diff --git a/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeApiClientMock.cs b/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeApiClientMock.cs index 5d66b04ac..2e96e12d9 100644 --- a/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeApiClientMock.cs +++ b/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeApiClientMock.cs @@ -1,11 +1,10 @@ -using Rocket.Surgery.Airframe.Data; using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Reactive.Subjects; -namespace Airframe.Data.Tests.Jokes.ChuckNorris +namespace Rocket.Surgery.Airframe.Data.Tests.Jokes.ChuckNorris { public class ChuckNorrisJokeApiClientMock : IChuckNorrisJokeApiClient { diff --git a/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeServiceTests.cs b/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeServiceTests.cs index 3ffd7d870..149b91255 100644 --- a/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeServiceTests.cs +++ b/test/Data.Tests/Jokes/ChuckNorris/ChuckNorrisJokeServiceTests.cs @@ -1,6 +1,5 @@ using FluentAssertions; using NSubstitute; -using Rocket.Surgery.Airframe.Data; using Rocket.Surgery.Extensions.Testing.Fixtures; using System; using System.Collections; @@ -9,7 +8,7 @@ using System.Linq; using Xunit; -namespace Airframe.Data.Tests.Jokes.ChuckNorris +namespace Rocket.Surgery.Airframe.Data.Tests.Jokes.ChuckNorris { [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1312:Variable names should begin with lower-case letter", Justification = "Discarded variable.")] public class ChuckNorrisJokeServiceTests @@ -113,11 +112,13 @@ internal class CategoryTests : IEnumerable private readonly IEnumerable _exclude = new[] { "One Fish", "Two Fish" }; private readonly IEnumerable _include = new[] { "Red Fish", "Blue Fish" }; + /// public IEnumerator GetEnumerator() { yield return new object[] { _include, _exclude }; } + /// IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } } \ No newline at end of file