diff --git a/src/core/Akka.Streams.TestKit/TestSubscriber.cs b/src/core/Akka.Streams.TestKit/TestSubscriber.cs index 03fb93731be..e7fec931be3 100644 --- a/src/core/Akka.Streams.TestKit/TestSubscriber.cs +++ b/src/core/Akka.Streams.TestKit/TestSubscriber.cs @@ -150,7 +150,7 @@ public T ExpectNext(TimeSpan timeout) /// public ManualProbe ExpectNext(T element) { - _probe.ExpectMsg>(x => Equals(x.Element, element)); + _probe.ExpectMsg>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element)); return this; } @@ -159,7 +159,7 @@ public ManualProbe ExpectNext(T element) /// public ManualProbe ExpectNext(TimeSpan timeout, T element) { - _probe.ExpectMsg>(x => Equals(x.Element, element), timeout); + _probe.ExpectMsg>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element), timeout); return this; } @@ -168,7 +168,7 @@ public ManualProbe ExpectNext(TimeSpan timeout, T element) /// public ManualProbe ExpectNext(T element, TimeSpan timeout) { - _probe.ExpectMsg>(x => Equals(x.Element, element), timeout); + _probe.ExpectMsg>(x => AssertEquals(x.Element, element, "Expected '{0}', but got '{1}'", element, x.Element), timeout); return this; } @@ -227,7 +227,7 @@ public IEnumerable ExpectNextN(long n) public ManualProbe ExpectNextN(IEnumerable all) { foreach (var x in all) - _probe.ExpectMsg>(y => Equals(y.Element, x)); + _probe.ExpectMsg>(y => AssertEquals(y.Element, x, "Expected one of ({0}), but got '{1}'", string.Join(", ", all), y.Element)); return this; }