-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix new set of bugs related to tolerance
- Loading branch information
Cédric L. Charlier
committed
Dec 30, 2018
1 parent
c8797e8
commit f1e37d2
Showing
4 changed files
with
49 additions
and
2 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
45 changes: 45 additions & 0 deletions
45
NBi.Testing/Unit/Core/Scalar/Comparer/ToleranceFactoryTest.cs
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,45 @@ | ||
using NBi.Core.ResultSet; | ||
using NBi.Core.Scalar.Comparer; | ||
using NBi.Xml.Items.ResultSet; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBi.Testing.Unit.Core.Scalar.Comparer | ||
{ | ||
public class ToleranceFactoryTest | ||
{ | ||
[Test] | ||
[TestCase(ColumnRole.Key)] | ||
[TestCase(ColumnRole.Value)] | ||
[TestCase(ColumnRole.Ignore)] | ||
public void Instantiate_NoToleranceDefined_InstantiatedToNullOrNone(ColumnRole columnRole) | ||
{ | ||
var colDef = new ColumnDefinitionXml() | ||
{ | ||
Index = 0, | ||
Role = columnRole, | ||
Tolerance = string.Empty | ||
}; | ||
var tolerance = ToleranceFactory.Instantiate(colDef); | ||
|
||
Assert.That(Tolerance.IsNullOrNone(tolerance), Is.True); | ||
} | ||
|
||
[Test] | ||
[TestCase(ColumnType.Text)] | ||
[TestCase(ColumnType.Numeric)] | ||
[TestCase(ColumnType.DateTime)] | ||
[TestCase(ColumnType.Boolean)] | ||
public void Instantiate_NoToleranceDefined_InstantiatedToNullOrNone(ColumnType columnType) | ||
{ | ||
var tolerance = ToleranceFactory.Instantiate(columnType, string.Empty); | ||
Assert.That(Tolerance.IsNullOrNone(tolerance), Is.True); | ||
} | ||
} | ||
} |
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