-
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 #16 from dills122/number-range
added ranges to number scrubbers
- Loading branch information
Showing
9 changed files
with
110 additions
and
3 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
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,37 @@ | ||
using ShamWow.Processor; | ||
using ShamWow.Tests.TestModels; | ||
using Xunit; | ||
|
||
namespace ShamWow.Tests | ||
{ | ||
public class RangeTest | ||
{ | ||
const int predefinedValue = 1000; | ||
|
||
[Fact] | ||
public void SimpleTest() | ||
{ | ||
var obj = new RangeTestObj | ||
{ | ||
dec = predefinedValue, | ||
dub = predefinedValue, | ||
ing = predefinedValue, | ||
lng = predefinedValue | ||
}; | ||
|
||
IShamWow processor = ShamWowEngine.GetFactory().Create(obj, Constants.ScrubMode.Marked); | ||
|
||
processor.Scrub(); | ||
var cleanedData = (RangeTestObj)processor.CleanData(); | ||
|
||
var man = processor.GetManifest(); | ||
Assert.InRange(cleanedData.dub, 100, 200); | ||
Assert.InRange(cleanedData.dec, 100, 200); | ||
Assert.InRange(cleanedData.ing, 100, 200); | ||
Assert.InRange(cleanedData.lng, 100, 200); | ||
Assert.NotNull(cleanedData); | ||
Assert.IsType<RangeTestObj>(cleanedData); | ||
Assert.True(processor.CheckManifest()); | ||
} | ||
} | ||
} |
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,16 @@ | ||
using ShamWow.Interfaces.Attributes; | ||
|
||
namespace ShamWow.Tests.TestModels | ||
{ | ||
public class RangeTestObj | ||
{ | ||
[ScrubDecimal(100, 200)] | ||
public decimal dec { get; set; } | ||
[ScrubDouble(100, 200)] | ||
public double dub { get; set; } | ||
[ScrubInteger(100, 200)] | ||
public int ing { get; set; } | ||
[ScrubLong(100, 200)] | ||
public long lng { get; set; } | ||
} | ||
} |
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