diff --git a/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj b/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj index 72235957f88..605bb27740d 100644 --- a/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj +++ b/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj @@ -13,7 +13,6 @@ - diff --git a/src/core/Akka.Streams.TestKit/SubscriberFluentBuilder.cs b/src/core/Akka.Streams.TestKit/SubscriberFluentBuilder.cs index 400badae0e1..dfbca06f265 100644 --- a/src/core/Akka.Streams.TestKit/SubscriberFluentBuilder.cs +++ b/src/core/Akka.Streams.TestKit/SubscriberFluentBuilder.cs @@ -8,12 +8,12 @@ #nullable enable using System; using System.Collections.Generic; +using System.Globalization; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using Akka.TestKit; using Reactive.Streams; -using Xunit.Sdk; using static Akka.Streams.TestKit.TestSubscriber; namespace Akka.Streams.TestKit @@ -411,7 +411,10 @@ public SubscriberFluentBuilder RequestNextN(params T[] elements) var next = await probe.ExpectNextAsync(ct); if (Comparer.Default.Compare(elements[i], next) != 0) { - throw new CollectionException(elements, elements.Length, i + 1, i); + throw new Exception(string.Format( + CultureInfo.CurrentCulture, + "Collection Comparison Failure{3}Error during comparison of item at index {0}. Expected: {1}, found: {2}", + i, elements[i], next, Environment.NewLine)); } } }); diff --git a/src/core/Akka.Streams.TestKit/TestSubscriber_Shared.cs b/src/core/Akka.Streams.TestKit/TestSubscriber_Shared.cs index c64ce62eb23..20a301bcf52 100644 --- a/src/core/Akka.Streams.TestKit/TestSubscriber_Shared.cs +++ b/src/core/Akka.Streams.TestKit/TestSubscriber_Shared.cs @@ -15,7 +15,6 @@ using System.Threading.Tasks; using Akka.TestKit; using Reactive.Streams; -using Xunit.Sdk; namespace Akka.Streams.TestKit { diff --git a/src/core/Akka.Streams.TestKit/Utils.cs b/src/core/Akka.Streams.TestKit/Utils.cs index a5ffca67194..f903b8e7f9b 100644 --- a/src/core/Akka.Streams.TestKit/Utils.cs +++ b/src/core/Akka.Streams.TestKit/Utils.cs @@ -16,6 +16,7 @@ using Akka.TestKit; using Akka.TestKit.Extensions; using Akka.Util.Internal; +using FluentAssertions; using FluentAssertions.Extensions; namespace Akka.Streams.TestKit @@ -26,7 +27,7 @@ public static class Utils ConfigurationFactory.ParseString(@"akka.actor.default-mailbox.mailbox-type = ""Akka.Dispatch.UnboundedMailbox, Akka"""); public static void AssertAllStagesStopped( - this AkkaSpec spec, + this TestKitBase spec, Action block, IMaterializer materializer, TimeSpan? timeout = null, @@ -39,7 +40,7 @@ public static void AssertAllStagesStopped( .ConfigureAwait(false).GetAwaiter().GetResult(); public static T AssertAllStagesStopped( - this AkkaSpec spec, + this TestKitBase spec, Func block, IMaterializer materializer, TimeSpan? timeout = null, @@ -48,7 +49,7 @@ public static T AssertAllStagesStopped( .ConfigureAwait(false).GetAwaiter().GetResult(); public static async Task AssertAllStagesStoppedAsync( - this AkkaSpec spec, + this TestKitBase spec, Func block, IMaterializer materializer, TimeSpan? timeout = null, @@ -61,7 +62,7 @@ public static async Task AssertAllStagesStoppedAsync( .ConfigureAwait(false); public static async Task AssertAllStagesStoppedAsync( - this AkkaSpec spec, + this TestKitBase spec, Func> block, IMaterializer materializer, TimeSpan? timeout = null, @@ -117,7 +118,7 @@ public static void AssertDispatcher(IActorRef @ref, string dispatcher) [Obsolete("Use ShouldCompleteWithin instead")] public static T AwaitResult(this Task task, TimeSpan? timeout = null) { - task.Wait(timeout??TimeSpan.FromSeconds(3)).ShouldBeTrue(); + task.Wait(timeout??TimeSpan.FromSeconds(3)).Should().BeTrue(); return task.Result; } } diff --git a/src/core/Akka.Streams.TestKit/BaseTwoStreamsSetup.cs b/src/core/Akka.Streams.Tests/BaseTwoStreamsSetup.cs similarity index 98% rename from src/core/Akka.Streams.TestKit/BaseTwoStreamsSetup.cs rename to src/core/Akka.Streams.Tests/BaseTwoStreamsSetup.cs index 8b46b11b0b7..0c0d65e7a9e 100644 --- a/src/core/Akka.Streams.TestKit/BaseTwoStreamsSetup.cs +++ b/src/core/Akka.Streams.Tests/BaseTwoStreamsSetup.cs @@ -9,13 +9,14 @@ using System.Collections.Generic; using System.Threading.Tasks; using Akka.Streams.Dsl; +using Akka.Streams.TestKit; using Akka.TestKit; using FluentAssertions; using Reactive.Streams; using Xunit; using Xunit.Abstractions; -namespace Akka.Streams.TestKit +namespace Akka.Streams.Tests { public abstract class BaseTwoStreamsSetup : AkkaSpec { diff --git a/src/core/Akka.Streams.TestKit/ScriptedTest.cs b/src/core/Akka.Streams.Tests/ScriptedTest.cs similarity index 99% rename from src/core/Akka.Streams.TestKit/ScriptedTest.cs rename to src/core/Akka.Streams.Tests/ScriptedTest.cs index 32eb532aac3..a9a5c6eb391 100644 --- a/src/core/Akka.Streams.TestKit/ScriptedTest.cs +++ b/src/core/Akka.Streams.Tests/ScriptedTest.cs @@ -14,15 +14,15 @@ using Akka.Actor; using Akka.Configuration; using Akka.Streams.Dsl; +using Akka.Streams.TestKit; using Akka.TestKit; using Akka.TestKit.Extensions; using Akka.Util; -using Akka.Util.Internal; using FluentAssertions.Extensions; using Reactive.Streams; using Xunit.Abstractions; -namespace Akka.Streams.TestKit +namespace Akka.Streams.Tests { [Serializable] public class ScriptException : Exception diff --git a/src/core/Akka.Streams.TestKit/TwoStreamsSetup.cs b/src/core/Akka.Streams.Tests/TwoStreamsSetup.cs similarity index 96% rename from src/core/Akka.Streams.TestKit/TwoStreamsSetup.cs rename to src/core/Akka.Streams.Tests/TwoStreamsSetup.cs index 84ae7b3ba3c..c3f40384202 100644 --- a/src/core/Akka.Streams.TestKit/TwoStreamsSetup.cs +++ b/src/core/Akka.Streams.Tests/TwoStreamsSetup.cs @@ -6,10 +6,11 @@ //----------------------------------------------------------------------- using Akka.Streams.Dsl; +using Akka.Streams.TestKit; using Reactive.Streams; using Xunit.Abstractions; -namespace Akka.Streams.TestKit +namespace Akka.Streams.Tests { public abstract class TwoStreamsSetup : BaseTwoStreamsSetup {