@@ -570,7 +570,7 @@ public void Ensure_Defaults_Are_Called_When_Empty_Args_Specified()
570
570
bool actualBool = false ;
571
571
572
572
parser . Setup < int > ( 'i' ) . Callback ( i => actualInt = i ) . SetDefault ( expectedInt ) ;
573
- parser . Setup < string > ( 's' ) . Callback ( s=> actualString = s ) . SetDefault ( expectedString ) ;
573
+ parser . Setup < string > ( 's' ) . Callback ( s => actualString = s ) . SetDefault ( expectedString ) ;
574
574
parser . Setup < bool > ( 'b' ) . Callback ( b => actualBool = b ) . SetDefault ( expectedBool ) ;
575
575
parser . Setup < double > ( 'd' ) . Callback ( d => actualDouble = d ) . SetDefault ( expectedDouble ) ;
576
576
@@ -660,7 +660,7 @@ public void Setup_Help_And_Ensure_It_Is_Called_With_Custom_Formatter()
660
660
661
661
var formatter = new Mock < ICommandLineOptionFormatter > ( ) ;
662
662
663
- var args = new [ ] { "/help" , "i" , "s" } ;
663
+ var args = new [ ] { "/help" , "i" , "s" } ;
664
664
const string expectedCallbackResult = "blah" ;
665
665
string callbackResult = null ;
666
666
@@ -708,6 +708,49 @@ public void Setup_Help_And_Ensure_It_Is_Called()
708
708
709
709
#endregion
710
710
711
+ #region Case Sensitive
712
+
713
+ [ Test ]
714
+ public void Ensure_Short_Options_Are_Case_Sensitive ( )
715
+ {
716
+ var parser = CreateFluentParser ( ) ;
717
+
718
+ const string expectedSValue = "my expected value" ;
719
+ string SValue ;
720
+ bool sValue = false ;
721
+
722
+ parser . Setup < string > ( 'S' ) . Callback ( str => SValue = str ) . Required ( ) ;
723
+ parser . Setup < bool > ( 's' ) . Callback ( b => sValue = b ) . Required ( ) ;
724
+
725
+ var result = parser . Parse ( new [ ] { "-S" , expectedSValue , "-s" } ) ;
726
+
727
+ Assert . IsFalse ( result . HasErrors ) ;
728
+ Assert . AreEqual ( expectedSValue , expectedSValue ) ;
729
+ Assert . IsTrue ( sValue ) ;
730
+ }
731
+
732
+
733
+ [ Test ]
734
+ public void Ensure_Long_Options_Are_Case_Sensitive ( )
735
+ {
736
+ var parser = CreateFluentParser ( ) ;
737
+
738
+ const string expectedSValue = "my expected value" ;
739
+ string SValue ;
740
+ bool sValue = false ;
741
+
742
+ parser . Setup < string > ( "LONGOPTION" ) . Callback ( str => SValue = str ) . Required ( ) ;
743
+ parser . Setup < bool > ( "longoption" ) . Callback ( b => sValue = b ) . Required ( ) ;
744
+
745
+ var result = parser . Parse ( new [ ] { "--LONGOPTION" , expectedSValue , "--longoption" } ) ;
746
+
747
+ Assert . IsFalse ( result . HasErrors ) ;
748
+ Assert . AreEqual ( expectedSValue , expectedSValue ) ;
749
+ Assert . IsTrue ( sValue ) ;
750
+ }
751
+
752
+ #endregion
753
+
711
754
#endregion Top Level Tests
712
755
713
756
#region Duplicate Options Tests
0 commit comments