-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: prevent further operations if score already lower than threshold (
#110)
- Loading branch information
1 parent
6b3825e
commit b5c999d
Showing
5 changed files
with
215 additions
and
36 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
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,48 @@ | ||
using Biomatch.Domain.Models; | ||
using FluentAssertions; | ||
|
||
namespace Biomatch.Domain.Tests.Unit; | ||
|
||
public class MatchTests | ||
{ | ||
[Fact] | ||
public void CompareRecords_ShouldReturnPotentialMatch_WhenMatchIsFound() | ||
{ | ||
var patientRecords = new List<IPersonRecord> | ||
{ | ||
new PersonRecord( | ||
"1230", | ||
"Clara", | ||
"", | ||
"Pique", | ||
"", | ||
new DateOnly(1995, 02, 01), | ||
"Adjuntas", | ||
"" | ||
), | ||
new PersonRecord( | ||
"1875", | ||
"Clara", | ||
"", | ||
"Pique", | ||
"", | ||
new DateOnly(1995, 01, 02), | ||
"Adjuntas", | ||
"" | ||
), | ||
}; | ||
|
||
var preprocessedRecords = patientRecords.PreprocessData().ToArray(); | ||
|
||
// Act | ||
var duplicatesToFix = Match.CompareRecords( | ||
ref preprocessedRecords[0], | ||
ref preprocessedRecords[1], | ||
0.60, | ||
1.0 | ||
); | ||
|
||
// Assert | ||
duplicatesToFix.Should().NotBeNull(); | ||
} | ||
} |