Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Akka.Tests.Shared.Internals from Akka.Streams.TestKit dependency #6258

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 void AssertAllStagesStopped(
.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 T AssertAllStagesStopped<T>(
.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 async Task AssertAllStagesStoppedAsync(
.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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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