Skip to content

Instantly share code, notes, and snippets.

@tomliversidge
Created April 7, 2017 07:37
Show Gist options
  • Save tomliversidge/0bb0d84931e4de369925d7630bb17a96 to your computer and use it in GitHub Desktop.
Save tomliversidge/0bb0d84931e4de369925d7630bb17a96 to your computer and use it in GitHub Desktop.
Example using static
[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