diff --git a/Nixie.Tests/TestLazyAsync.cs b/Nixie.Tests/TestLazyAsync.cs new file mode 100644 index 0000000..60572ae --- /dev/null +++ b/Nixie.Tests/TestLazyAsync.cs @@ -0,0 +1,24 @@ + +namespace Nixie.Tests; + +public class SomeResultAsync +{ + +} + +[Collection("Nixie")] +public class TestLazyAsync +{ + [Fact] + public async Task TestAskMessageToSingleActor() + { + LazyTask task = CreateResultAsync(); + Assert.NotNull(await task); + } + + private async LazyTask CreateResultAsync() + { + await Task.Delay(100); + return new SomeResultAsync(); + } +} \ No newline at end of file diff --git a/Nixie/LazyTaskMethodBuilder.cs b/Nixie/LazyTaskMethodBuilder.cs index d4b0542..77746c3 100644 --- a/Nixie/LazyTaskMethodBuilder.cs +++ b/Nixie/LazyTaskMethodBuilder.cs @@ -1,4 +1,6 @@  +#pragma warning disable CA1000 + using System.Runtime.CompilerServices; namespace Nixie; @@ -7,7 +9,7 @@ public class LazyTaskMethodBuilder { public LazyTaskMethodBuilder() => Task = new LazyTask(); - //public static LazyTaskMethodBuilder Create() => new(); + public static LazyTaskMethodBuilder Create() => new(); public void Start(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine { @@ -42,3 +44,5 @@ public void GenericAwaitOnCompleted(ref TAwaiter awaite public LazyTask Task { get; } } + +#pragma warning restore CA1000 \ No newline at end of file