File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/TestStack.BDDfy.Tests/Scanner/FluentScanner Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using Shouldly ;
3+ using Xunit ;
4+
5+ namespace TestStack . BDDfy . Tests . Scanner . FluentScanner
6+ {
7+ public class AmbiguousHeaderMatchTests
8+ {
9+ private int _count ;
10+
11+ [ Fact ]
12+ public void ThrowsWhenMultipleHeadersMatchParameterName ( )
13+ {
14+ // Act & Assert
15+ var exception = Should . Throw < AmbiguousMatchException > ( ( ) =>
16+ {
17+ this . Given ( _ => GivenInput ( _count ) ) // Will try to bind _count to both "count" and "Count" headers
18+ . WithExamples ( new ExampleTable ( "count" , "Count" ) // Deliberately ambiguous headers
19+ {
20+ { 5 , 10 }
21+ } )
22+ . BDDfy ( ) ;
23+ } ) ;
24+
25+ exception . Message . ShouldBe ( "More than one headers for examples, match the parameter 'count' provided for 'GivenInput'" ) ;
26+ }
27+
28+ private void GivenInput ( int count )
29+ {
30+ // The method exists just to trigger the ambiguous header match
31+ }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments