Skip to content

Commit

Permalink
Remove Akka.Tests.Shared.Internals from Akka.Streams.TestKit dependen…
Browse files Browse the repository at this point in the history
…cy (#6258)
  • Loading branch information
Arkatufus committed Nov 18, 2022
1 parent 88ebfa9 commit 76b1886
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj
Expand Up @@ -13,7 +13,6 @@
<ItemGroup>
<ProjectReference Include="..\Akka.Streams\Akka.Streams.csproj" />
<ProjectReference Include="..\Akka.TestKit\Akka.TestKit.csproj" />
<ProjectReference Include="..\Akka.Tests.Shared.Internals\Akka.Tests.Shared.Internals.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions src/core/Akka.Streams.TestKit/SubscriberFluentBuilder.cs
Expand Up @@ -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
Expand Down Expand Up @@ -411,7 +411,10 @@ public SubscriberFluentBuilder<T> RequestNextN(params T[] elements)
var next = await probe.ExpectNextAsync(ct);
if (Comparer<T>.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));
}
}
});
Expand Down
1 change: 0 additions & 1 deletion src/core/Akka.Streams.TestKit/TestSubscriber_Shared.cs
Expand Up @@ -15,7 +15,6 @@
using System.Threading.Tasks;
using Akka.TestKit;
using Reactive.Streams;
using Xunit.Sdk;

namespace Akka.Streams.TestKit
{
Expand Down
11 changes: 6 additions & 5 deletions src/core/Akka.Streams.TestKit/Utils.cs
Expand Up @@ -16,6 +16,7 @@
using Akka.TestKit;
using Akka.TestKit.Extensions;
using Akka.Util.Internal;
using FluentAssertions;
using FluentAssertions.Extensions;

namespace Akka.Streams.TestKit
Expand All @@ -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,
Expand All @@ -39,7 +40,7 @@ public static class Utils
.ConfigureAwait(false).GetAwaiter().GetResult();

public static T AssertAllStagesStopped<T>(
this AkkaSpec spec,
this TestKitBase spec,
Func<T> block,
IMaterializer materializer,
TimeSpan? timeout = null,
Expand All @@ -48,7 +49,7 @@ public static class Utils
.ConfigureAwait(false).GetAwaiter().GetResult();

public static async Task AssertAllStagesStoppedAsync(
this AkkaSpec spec,
this TestKitBase spec,
Func<Task> block,
IMaterializer materializer,
TimeSpan? timeout = null,
Expand All @@ -61,7 +62,7 @@ public static class Utils
.ConfigureAwait(false);

public static async Task<T> AssertAllStagesStoppedAsync<T>(
this AkkaSpec spec,
this TestKitBase spec,
Func<Task<T>> block,
IMaterializer materializer,
TimeSpan? timeout = null,
Expand Down Expand Up @@ -117,7 +118,7 @@ public static void AssertDispatcher(IActorRef @ref, string dispatcher)
[Obsolete("Use ShouldCompleteWithin instead")]
public static T AwaitResult<T>(this Task<T> task, TimeSpan? timeout = null)
{
task.Wait(timeout??TimeSpan.FromSeconds(3)).ShouldBeTrue();
task.Wait(timeout??TimeSpan.FromSeconds(3)).Should().BeTrue();
return task.Result;
}
}
Expand Down
Expand Up @@ -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<TOutputs> : AkkaSpec
{
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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<TOutputs> : BaseTwoStreamsSetup<TOutputs>
{
Expand Down

0 comments on commit 76b1886

Please sign in to comment.