Created
April 7, 2017 07:37
-
-
Save tomliversidge/0bb0d84931e4de369925d7630bb17a96 to your computer and use it in GitHub Desktop.
Example using static
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Collection("EventStream Tests")] | |
public class DeadLetterTests | |
{ | |
[Fact] | |
public void WhenActorStopped_MessagesGoToDeadLetter() | |
{ | |
bool deadLetterEventReceived = false; | |
EventStream.Instance.Subscribe<DeadLetterEvent>(@event => deadLetterEventReceived = true); | |
var props = Actor.FromProducer(() => new DoNothingActor()) | |
.WithMailbox(() => new TestMailbox()); | |
var pid = Actor.Spawn(props); | |
pid.Stop(); | |
pid.Tell("did you die?"); | |
Assert.True(deadLetterEventReceived); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment