-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from vforteli/feature/options
Feature/options
- Loading branch information
Showing
7 changed files
with
321 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
namespace FuzzySearchNet.Tests; | ||
|
||
public class FuzzySearchOptionsTests | ||
{ | ||
[Test] | ||
public void TestCanSubstituteTotalDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanSubstitute(3, 1), Is.False); | ||
Assert.That(options.CanSubstitute(2, 1)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanSubstituteTotalAndMaxDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3, 1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanSubstitute(2, 1), Is.False); | ||
Assert.That(options.CanSubstitute(2, 0)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanSubstituteMaxSubstitutions() | ||
{ | ||
var options = new FuzzySearchOptions(1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanSubstitute(100, 1), Is.False); | ||
Assert.That(options.CanSubstitute(0, 0)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanDeleteTotalDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanDelete(3, 1), Is.False); | ||
Assert.That(options.CanDelete(2, 1)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanDeleteTotalAndMaxDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3, 1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanDelete(2, 1), Is.False); | ||
Assert.That(options.CanDelete(2, 0)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanDeleteMaxSubstitutions() | ||
{ | ||
var options = new FuzzySearchOptions(1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanDelete(100, 1), Is.False); | ||
Assert.That(options.CanDelete(0, 0)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanInsertTotalDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanInsert(3, 1), Is.False); | ||
Assert.That(options.CanInsert(2, 1)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanInsertTotalAndMaxDistance() | ||
{ | ||
var options = new FuzzySearchOptions(3, 1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanInsert(2, 1), Is.False); | ||
Assert.That(options.CanInsert(2, 0)); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void TestCanInsertMaxSubstitutions() | ||
{ | ||
var options = new FuzzySearchOptions(1, 1, 1); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(options.CanInsert(100, 1), Is.False); | ||
Assert.That(options.CanInsert(0, 0)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.