Skip to content

Commit

Permalink
Fix of EventFilter.And from Akka.testKit when one parameter is string (
Browse files Browse the repository at this point in the history
  • Loading branch information
F0b0s committed Jan 27, 2023
1 parent a447760 commit 2f54792
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Event;
Expand Down Expand Up @@ -47,6 +48,26 @@ await eventFilter.DeadLetter().ExpectOneAsync(async () =>
_deadActor.Tell("whatever");
});
}

[Fact]
public async Task Should_check_properly_type_parameters()
{
await EventFilter.DeadLetter<int>().And.DeadLetter<double>().ExpectAsync(2, async () =>
{
_deadActor.Tell(5);
_deadActor.Tell(1.2);
});
}

[Fact]
public async Task Should_check_properly_type_parameters_when_one_of_them_string()
{
await EventFilter.DeadLetter<string>().And.DeadLetter<double>().ExpectAsync(2, async () =>
{
_deadActor.Tell("asd");
_deadActor.Tell(1.2);
});
}
}

public class DeadLettersEventFilterTests : DeadLettersEventFilterTestsBase
Expand Down
5 changes: 1 addition & 4 deletions src/core/Akka.TestKit/EventFilter/TestEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ private void HandleDeadLetter(DeadLetter message)
? "Received dead system message: " + msg
: "Received dead letter from " + snd + ": " + msg;
var warning2 = new Warning(recipientPath, recipientType, new DeadLetter(msgStr, snd, rcp));
if (!ShouldFilter(warning2))
{
Print(warning2);
}
Print(warning2);
}
}
}
Expand Down

0 comments on commit 2f54792

Please sign in to comment.