-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…7425) close #7938
- Loading branch information
1 parent
487bb85
commit 7e85cac
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="Bugfix7398Specs.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2024 Lightbend Inc. <http://www.lightbend.com> | ||
// Copyright (C) 2013-2024 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
using Akka.Actor; | ||
using Akka.TestKit; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Tests.Actor.Stash; | ||
|
||
public class Bugfix7398Specs : AkkaSpec | ||
{ | ||
public Bugfix7398Specs(ITestOutputHelper output) | ||
: base(output) | ||
{ | ||
} | ||
|
||
private class IllegalStashActor : UntypedActor, IWithStash | ||
{ | ||
protected override void OnReceive(object message) | ||
{ | ||
|
||
} | ||
|
||
protected override void PreStart() | ||
{ | ||
// ILLEGAL | ||
Stash.Stash(); | ||
} | ||
|
||
public IStash Stash { get; set; } | ||
} | ||
|
||
[Fact] | ||
public void Should_throw_exception_when_stashing_in_PreStart() | ||
{ | ||
EventFilter.Exception<ActorInitializationException>().ExpectOne(() => | ||
{ | ||
var actor = Sys.ActorOf(Props.Create<IllegalStashActor>()); | ||
actor.Tell("hello"); | ||
}); | ||
} | ||
} |
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