@@ -20,46 +20,24 @@ public static class StoryAttributeTests
2020 /// <summary>
2121 /// Tests the <see cref="StoryAttribute.TestName"/>.
2222 /// </summary>
23- [ Test ( Description = "When an id and summary are provided Should return the test name" ) ]
23+ [ Test ( Description = "When an id and summary are provided Should return the test name and corresponding properties " ) ]
2424 public static void TestName ( )
2525 {
2626 // Arrange
27- var componentTestAttribute = new StoryAttribute { Id = "ID-123" , Summary = "Some summary" } ;
27+ var storyTestAttribute = new StoryAttribute { Id = "ID-123" , Summary = "Some summary" } ;
2828
2929 // Act
30- var testName = componentTestAttribute . GetType ( ) . GetProperty (
30+ var testName = storyTestAttribute . GetType ( ) . GetProperty (
3131 nameof ( TestName ) ,
32- BindingFlags . Instance | BindingFlags . NonPublic ) . GetValue ( componentTestAttribute ) as string ;
32+ BindingFlags . Instance | BindingFlags . NonPublic ) . GetValue ( storyTestAttribute ) as string ;
3333
34- // Assert
35- Assert . That ( testName , Is . EqualTo ( "ID-123: Some summary" ) ) ;
36- }
37-
38- /// <summary>
39- /// Tests the <see cref="StoryAttribute.Properties"/>.
40- /// </summary>
41- [ Test ( Description = "When an AsA, IWant, SoThat are provided Should return properties with those statements" ) ]
42- public static void Properties ( )
43- {
44- // Arrange
45- var componentTestAttribute = new StoryAttribute
46- {
47- Id = "ID-1" ,
48- Summary = "Summary" ,
49- AsA = "PO" ,
50- IWant = "Everything" ,
51- SoThat = "I'm ok" ,
52- } ;
53-
54- // Act
55- var properties = componentTestAttribute . GetType ( ) . GetProperty (
56- nameof ( Properties ) ,
57- BindingFlags . Instance | BindingFlags . NonPublic ) . GetValue ( componentTestAttribute )
58- as IDictionary < string , object > ;
34+ var properties = storyTestAttribute . GetType ( ) . GetProperty (
35+ "Properties" ,
36+ BindingFlags . Instance | BindingFlags . NonPublic ) . GetValue ( storyTestAttribute ) as IDictionary < string , object > ;
5937
6038 // Assert
61- Assert . That ( properties . Count , Is . EqualTo ( 1 ) ) ;
62- Assert . That ( properties [ "Heleonix.Testing.NUnit.Internal.Output.TestName" ] , Is . EqualTo ( "ID-1: Summary " ) ) ;
39+ Assert . That ( testName , Is . EqualTo ( "ID-123: Some summary" ) ) ;
40+ Assert . That ( properties [ "Heleonix.Testing.NUnit.Internal.Output.TestName" ] , Is . EqualTo ( "ID-123: Some summary " ) ) ;
6341 }
6442 }
6543}
0 commit comments