-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestWithDescription.cs
More file actions
36 lines (30 loc) · 1.52 KB
/
TestWithDescription.cs
File metadata and controls
36 lines (30 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using CSF.Screenplay.Performances;
namespace CSF.Screenplay;
[TestFixture,Parallelizable,Description("This is a test fixture with a description")]
public class TestWithDescription
{
[Test,Screenplay,Description("This is the first test")]
public void FirstTest(IPerformance performance)
{
IdentifierAndName[] expectedNamingHierarchy = [
new(typeof(TestWithDescription).FullName, "This is a test fixture with a description"),
new($"{typeof(TestWithDescription).FullName}.{nameof(FirstTest)}", "This is the first test"),
];
AssertThatPerformanceHasCorrectState(performance, expectedNamingHierarchy);
}
[Test,Screenplay,Description("This is the second test")]
public void SecondTest(IPerformance performance)
{
IdentifierAndName[] expectedNamingHierarchy = [
new(typeof(TestWithDescription).FullName, "This is a test fixture with a description"),
new($"{typeof(TestWithDescription).FullName}.{nameof(SecondTest)}", "This is the second test"),
];
AssertThatPerformanceHasCorrectState(performance, expectedNamingHierarchy);
}
static void AssertThatPerformanceHasCorrectState(IPerformance performance, IdentifierAndName[] expectedNamingHierarchy)
{
using var scope = Assert.EnterMultipleScope();
Assert.That(performance, Is.Not.Null, "Performance must not be null");
Assert.That(performance.NamingHierarchy, Is.EqualTo(expectedNamingHierarchy), "Performance naming hierarchy is correct");
}
}