Skip to content

Commit 08a674d

Browse files
committed
Add more tests for #250
1 parent 89e642a commit 08a674d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Tests/CSF.Screenplay.Tests/ScreenplayExtensionsTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using CSF.Screenplay.Performances;
22
using Microsoft.Extensions.DependencyInjection;
3+
using NUnit.Framework.Internal;
34

45
namespace CSF.Screenplay;
56

@@ -71,6 +72,18 @@ public void ExecuteAsPerformanceGenericShouldExecuteThePerformanceHostLogic()
7172
Assert.That(sut.ServiceProvider.GetRequiredService<SamplePerformanceHost>().HasExecuted, Is.True);
7273
}
7374

75+
[Test, AutoMoqData]
76+
public void GetEventBusShouldReturnAnEventBus([DefaultScreenplay] Screenplay sut)
77+
{
78+
Assert.That(() => sut.GetEventBus(), Is.InstanceOf<PerformanceEventBus>());
79+
}
80+
81+
[Test, AutoMoqData]
82+
public void GetEventBusShouldThrowIfScreenplayIsNull()
83+
{
84+
Assert.That(() => ((Screenplay?) null).GetEventBus(), Throws.ArgumentNullException);
85+
}
86+
7487
public class SamplePerformanceHost : IHostsPerformance
7588
{
7689
public bool HasExecuted { get; set; }

0 commit comments

Comments
 (0)