@@ -648,6 +648,30 @@ public void AssertIsNotType_TestAnalyzer(string assertion) =>
648648 public void AssertIsNotType_TestCodeFix ( string oldAssertion , string newAssertion )
649649 => VerifyCSharpFix ( "string actual, Type expected" , oldAssertion , newAssertion ) ;
650650
651+ [ DataTestMethod ]
652+ [ DataRow ( "Assert.InRange(actual, low, high);" ) ]
653+ [ Implemented ]
654+ public void AssertInRange_TestAnalyzer ( string assertion )
655+ {
656+ VerifyCSharpDiagnostic ( "double actual, double low, double high" , assertion ) ;
657+ VerifyCSharpDiagnostic ( "float actual, float low, float high" , assertion ) ;
658+ VerifyCSharpDiagnostic ( "int actual, int low, int high" , assertion ) ;
659+ VerifyCSharpDiagnostic ( "long actual, long low, long high" , assertion ) ;
660+ }
661+
662+ [ DataTestMethod ]
663+ [ DataRow (
664+ /* oldAssertion: */ "Assert.InRange(actual, low, high);" ,
665+ /* newAssertion: */ "actual.Should().BeInRange(low, high);" ) ]
666+ [ Implemented ]
667+ public void AssertInRange_TestCodeFix ( string oldAssertion , string newAssertion )
668+ {
669+ VerifyCSharpFix ( "double actual, double low, double high" , oldAssertion , newAssertion ) ;
670+ VerifyCSharpFix ( "float actual, float low, float high" , oldAssertion , newAssertion ) ;
671+ VerifyCSharpFix ( "int actual, int low, int high" , oldAssertion , newAssertion ) ;
672+ VerifyCSharpFix ( "long actual, long low, long high" , oldAssertion , newAssertion ) ;
673+ }
674+
651675 private void VerifyCSharpDiagnostic ( string methodArguments , string assertion )
652676 {
653677 var source = GenerateCode . XunitAssertion ( methodArguments , assertion ) ;
0 commit comments