Skip to content

Commit

Permalink
Human-friendly streams assertions (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Horusiath authored and marcpiechura committed Sep 26, 2017
1 parent baf65ea commit 1a3ea81
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 1a3ea81

Please sign in to comment.