@@ -9,7 +9,7 @@ public class BindingParserTests
99 [ Fact ]
1010 public void Parse_Sample_File ( )
1111 {
12- string xml = File . ReadAllText ( "Bindings/test.binds" ) ;
12+ string xml = File . ReadAllText ( "TestFiles/ Bindings/test.binds" ) ;
1313
1414 var content = BindingParser . Parse ( xml ) ;
1515
@@ -73,16 +73,7 @@ public void Parse_Should_Treat_NoDevice_EmptyKey_As_Unbound()
7373 . Parse ( xml )
7474 . ToDictionary ( c => c . Name ) ;
7575
76- controls . Should ( ) . ContainKeys ( "MouseReset" , "RollLeftButton" ) ;
77-
78- foreach ( var control in controls . Values )
79- {
80- control . Primary . HasValue . Should ( ) . BeFalse ( ) ;
81- control . Secondary . HasValue . Should ( ) . BeFalse ( ) ;
82- control . IsToggle . Should ( ) . BeNull ( ) ;
83- control . IsInverted . Should ( ) . BeNull ( ) ;
84- control . Deadzone . Should ( ) . BeNull ( ) ;
85- }
76+ controls . Should ( ) . NotContainKeys ( "MouseReset" , "RollLeftButton" ) ;
8677 }
8778
8879 [ Fact ]
@@ -113,54 +104,7 @@ public void Parse_Should_Map_Binding_Element_To_Primary_And_Read_Inverted_And_De
113104 control . IsToggle . Should ( ) . BeNull ( ) ;
114105 control . Deadzone . Should ( ) . Be ( 0.25f ) ;
115106 }
116-
117- [ Fact ]
118- public void Parse_Should_Handle_All_ToggleOn_Variants ( )
119- {
120- const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
121- <Root>
122- <!-- Explicit false -->
123- <BlockMouseDecay>
124- <Primary Device=""{NoDevice}"" Key="""" />
125- <Secondary Device=""{NoDevice}"" Key="""" />
126- <ToggleOn Value=""0"" />
127- </BlockMouseDecay>
128-
129- <!-- Explicit true -->
130- <ToggleFlightAssist>
131- <Primary Device=""Keyboard"" Key=""Key_Z"" />
132- <Secondary Device=""{NoDevice}"" Key="""" />
133- <ToggleOn Value=""1"" />
134- </ToggleFlightAssist>
135-
136- <!-- No Value attribute, taken from HCS pattern -->
137- <YawToRollButton>
138- <Primary Device=""{NoDevice}"" Key="""" />
139- <Secondary Device=""{NoDevice}"" Key="""" />
140- <ToggleOn />
141- </YawToRollButton>
142-
143- <!-- No ToggleOn at all -->
144- <MouseReset>
145- <Primary Device=""{NoDevice}"" Key="""" />
146- <Secondary Device=""{NoDevice}"" Key="""" />
147- </MouseReset>
148- </Root>" ;
149-
150- var controls = BindingParser
151- . Parse ( xml )
152- . ToDictionary ( c => c . Name ) ;
153-
154- controls [ "BlockMouseDecay" ] . IsToggle . Should ( ) . BeFalse ( ) ;
155- controls [ "ToggleFlightAssist" ] . IsToggle . Should ( ) . BeTrue ( ) ;
156-
157- // Presence of <ToggleOn /> with no Value attribute – treat as true
158- controls [ "YawToRollButton" ] . IsToggle . Should ( ) . BeTrue ( ) ;
159-
160- // No <ToggleOn> element at all
161- controls [ "MouseReset" ] . IsToggle . Should ( ) . BeNull ( ) ;
162- }
163-
107+
164108 [ Fact ]
165109 public void Parse_Should_Read_Modifiers_On_Primary_And_Secondary ( )
166110 {
0 commit comments