@@ -6,17 +6,17 @@ namespace EliteAPI.Tests.Bindings;
66public class BindingParserTests
77{
88
9- [ Test ]
9+ [ Fact ]
1010 public void Parse_Sample_File ( )
1111 {
12- string xml = File . ReadAllText ( "test.binds" ) ;
12+ string xml = File . ReadAllText ( "Bindings/ test.binds" ) ;
1313
1414 var content = BindingParser . Parse ( xml ) ;
1515
1616 content . Should ( ) . NotBeNull ( ) ;
1717 }
1818
19- [ Test ]
19+ [ Fact ]
2020 public void Parse_Should_Read_Simple_Primary_Keyboard_Bindings ( )
2121 {
2222 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -53,7 +53,7 @@ public void Parse_Should_Read_Simple_Primary_Keyboard_Bindings()
5353 yawRight . Secondary . HasValue . Should ( ) . BeFalse ( ) ;
5454 }
5555
56- [ Test ]
56+ [ Fact ]
5757 public void Parse_Should_Treat_NoDevice_EmptyKey_As_Unbound ( )
5858 {
5959 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -85,7 +85,7 @@ public void Parse_Should_Treat_NoDevice_EmptyKey_As_Unbound()
8585 }
8686 }
8787
88- [ Test ]
88+ [ Fact ]
8989 public void Parse_Should_Map_Binding_Element_To_Primary_And_Read_Inverted_And_Deadzone ( )
9090 {
9191 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -114,7 +114,7 @@ public void Parse_Should_Map_Binding_Element_To_Primary_And_Read_Inverted_And_De
114114 control . Deadzone . Should ( ) . Be ( 0.25f ) ;
115115 }
116116
117- [ Test ]
117+ [ Fact ]
118118 public void Parse_Should_Handle_All_ToggleOn_Variants ( )
119119 {
120120 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -161,7 +161,7 @@ public void Parse_Should_Handle_All_ToggleOn_Variants()
161161 controls [ "MouseReset" ] . IsToggle . Should ( ) . BeNull ( ) ;
162162 }
163163
164- [ Test ]
164+ [ Fact ]
165165 public void Parse_Should_Read_Modifiers_On_Primary_And_Secondary ( )
166166 {
167167 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -227,7 +227,7 @@ public void Parse_Should_Read_Modifiers_On_Primary_And_Secondary()
227227 secondReverseMod . Key . Should ( ) . Be ( "Key_RightShift" ) ;
228228 }
229229
230- [ Test ]
230+ [ Fact ]
231231 public void Parse_Should_Ignore_Hold_Child_And_Still_Parse_Binding_And_Toggle ( )
232232 {
233233 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -257,7 +257,7 @@ public void Parse_Should_Ignore_Hold_Child_And_Still_Parse_Binding_And_Toggle()
257257 control . IsToggle . Should ( ) . BeFalse ( ) ; // Value=""0""
258258 }
259259
260- [ Test ]
260+ [ Fact ]
261261 public void Parse_Should_Treat_Key_Attribute_Case_Insensitive ( )
262262 {
263263 // Based on ToggleVanityCamera in HCS, but with a meaningful secondary key
@@ -282,7 +282,7 @@ public void Parse_Should_Treat_Key_Attribute_Case_Insensitive()
282282 control . Secondary ! . Value . Key . Should ( ) . Be ( "Key_F12" ) ;
283283 }
284284
285- [ Test ]
285+ [ Fact ]
286286 public void Parse_Should_Handle_Float_Deadzone_Formats ( )
287287 {
288288 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -312,7 +312,7 @@ public void Parse_Should_Handle_Float_Deadzone_Formats()
312312 controls [ "VerticalThrustRaw" ] . Deadzone . Should ( ) . Be ( 7.0f ) ;
313313 }
314314
315- [ Test ]
315+ [ Fact ]
316316 public void Parse_Should_Ignore_Value_Only_Elements_And_Only_Return_Controls_With_Bindings ( )
317317 {
318318 const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
@@ -335,4 +335,17 @@ public void Parse_Should_Ignore_Value_Only_Elements_And_Only_Return_Controls_Wit
335335 controls . Select ( c => c . Name ) . Should ( ) . NotContain ( "MouseSensitivity" ) ;
336336 controls . Select ( c => c . Name ) . Should ( ) . NotContain ( "MouseGUI" ) ;
337337 }
338+
339+ [ Fact ]
340+ public void Parse_HCS_Bindings ( )
341+ {
342+ string xml = File . ReadAllText ( "TestFiles/Bindings/HCS Custom.4.2.binds" ) ;
343+
344+ var content = BindingParser . Parse ( xml ) ;
345+
346+ content . Should ( ) . NotBeNull ( ) ;
347+ content . Should ( ) . Contain ( c => c . Name == "CycleFireGroupPrevious" ) ;
348+ var control = content . Single ( c => c . Name == "CycleFireGroupPrevious" ) ;
349+ control . KeyCode . Should ( ) . Be ( "[160][72]" ) ; // LeftShift + H
350+ }
338351}
0 commit comments