Created
April 7, 2017 07:35
-
-
Save tomliversidge/63082b3e8c6e2496c024feee3adac369 to your computer and use it in GitHub Desktop.
Example passing in EventStream
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
[Fact] | |
public void WhenActorStopped_MessagesGoToDeadLetter() | |
{ | |
bool deadLetterEventReceived = false; | |
var eventStream = new EventStream(); | |
eventStream.Subscribe<DeadLetterEvent>(@event => deadLetterEventReceived = true); | |
var props = Actor.FromProducer(() => new DoNothingActor()) | |
.WithMailbox(() => new TestMailbox()) | |
.WithEventStream(eventStream); | |
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