@@ -131,16 +131,17 @@ public void GivenQueryString_WhenAppliedPrecisionFiltering_ThenShouldReturnGreat
131
131
132
132
[ TestCase ( Chrome , Chrome , 157 ) ]
133
133
[ TestCase ( Chrome , LastIsChrome , 147 ) ]
134
- [ TestCase ( Chrome , HelpCureHopeRaiseOnMindEntityChrome , 90 ) ]
134
+ [ TestCase ( "chro" , HelpCureHopeRaiseOnMindEntityChrome , 50 ) ]
135
+ [ TestCase ( "chr" , HelpCureHopeRaiseOnMindEntityChrome , 30 ) ]
135
136
[ TestCase ( Chrome , UninstallOrChangeProgramsOnYourComputer , 21 ) ]
136
137
[ TestCase ( Chrome , CandyCrushSagaFromKing , 0 ) ]
137
- [ TestCase ( "sql" , MicrosoftSqlServerManagementStudio , 90 ) ]
138
+ [ TestCase ( "sql" , MicrosoftSqlServerManagementStudio , 110 ) ]
138
139
[ TestCase ( "sql manag" , MicrosoftSqlServerManagementStudio , 121 ) ] //double spacing intended
139
140
public void WhenGivenQueryString_ThenShouldReturn_TheDesiredScoring (
140
141
string queryString , string compareString , int expectedScore )
141
142
{
142
143
// When, Given
143
- var matcher = new StringMatcher ( ) ;
144
+ var matcher = new StringMatcher { UserSettingSearchPrecision = SearchPrecisionScore . Regular } ;
144
145
var rawScore = matcher . FuzzyMatch ( queryString , compareString ) . RawScore ;
145
146
146
147
// Should
@@ -162,6 +163,7 @@ public void WhenGivenQueryString_ThenShouldReturn_TheDesiredScoring(
162
163
[ TestCase ( "vs" , VisualStudioCode , SearchPrecisionScore . Regular , true ) ]
163
164
[ TestCase ( "vc" , VisualStudioCode , SearchPrecisionScore . Regular , true ) ]
164
165
[ TestCase ( "vts" , VisualStudioCode , SearchPrecisionScore . Regular , false ) ]
166
+ [ TestCase ( "wt" , "Windows Terminal From Microsoft Store" , SearchPrecisionScore . Regular , false ) ]
165
167
public void WhenGivenDesiredPrecision_ThenShouldReturn_AllResultsGreaterOrEqual (
166
168
string queryString ,
167
169
string compareString ,
@@ -184,8 +186,8 @@ public void WhenGivenDesiredPrecision_ThenShouldReturn_AllResultsGreaterOrEqual(
184
186
185
187
// Should
186
188
Assert . AreEqual ( expectedPrecisionResult , matchResult . IsSearchPrecisionScoreMet ( ) ,
187
- $ "Query:{ queryString } { Environment . NewLine } " +
188
- $ "Compare:{ compareString } { Environment . NewLine } " +
189
+ $ "Query: { queryString } { Environment . NewLine } " +
190
+ $ "Compare: { compareString } { Environment . NewLine } " +
189
191
$ "Raw Score: { matchResult . RawScore } { Environment . NewLine } " +
190
192
$ "Precision Score: { ( int ) expectedPrecisionScore } ") ;
191
193
}
@@ -309,6 +311,7 @@ public void WhenMultipleResults_ExactMatchingResult_ShouldHaveGreatestScore(
309
311
[ TestCase ( "psc" , "Postman super Canary" , 100 ) ]
310
312
[ TestCase ( "vsp" , "Visual Studio" , 0 ) ]
311
313
[ TestCase ( "vps" , "Visual Studio" , 0 ) ]
314
+ [ TestCase ( Chrome , HelpCureHopeRaiseOnMindEntityChrome , 75 ) ]
312
315
public void WhenGivenAnAcronymQuery_ShouldReturnAcronymScore ( string queryString , string compareString ,
313
316
int desiredScore )
314
317
{
0 commit comments