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

Human-friendly streams assertions #3126

Merged
merged 1 commit into from
Sep 26, 2017
Merged
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
8 changes: 4 additions & 4 deletions src/core/Akka.Streams.TestKit/TestSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public T ExpectNext(TimeSpan timeout)
/// </summary>
public ManualProbe<T> ExpectNext(T element)
{
_probe.ExpectMsg<OnNext<T>>(x => Equals(x.Element, element));
_probe.ExpectMsg<OnNext<T>>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element));
return this;
}

Expand All @@ -159,7 +159,7 @@ public ManualProbe<T> ExpectNext(T element)
/// </summary>
public ManualProbe<T> ExpectNext(TimeSpan timeout, T element)
{
_probe.ExpectMsg<OnNext<T>>(x => Equals(x.Element, element), timeout);
_probe.ExpectMsg<OnNext<T>>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element), timeout);
return this;
}

Expand All @@ -168,7 +168,7 @@ public ManualProbe<T> ExpectNext(TimeSpan timeout, T element)
/// </summary>
public ManualProbe<T> ExpectNext(T element, TimeSpan timeout)
{
_probe.ExpectMsg<OnNext<T>>(x => Equals(x.Element, element), timeout);
_probe.ExpectMsg<OnNext<T>>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element), timeout);
return this;
}

Expand Down Expand Up @@ -227,7 +227,7 @@ public IEnumerable<T> ExpectNextN(long n)
public ManualProbe<T> ExpectNextN(IEnumerable<T> all)
{
foreach (var x in all)
_probe.ExpectMsg<OnNext<T>>(y => Equals(y.Element, x));
_probe.ExpectMsg<OnNext<T>>(y => AssertEquals(y.Element, x, "Expected one of ({0}), but got '{1}'", string.Join(", ", all), y.Element));

return this;
}
Expand Down