9d2a597e74
Bump Verify from 11.23.0 to 11.23.1 in /src |
||
---|---|---|
.github | ||
src | ||
.gitignore | ||
license.txt | ||
readme.md |
readme.md
Verify.NodaTime
Adds Verify support for scrubbing NodaTime values.
NuGet package
https://nuget.org/packages/Verify.NodaTime/
Usage
Before any tests have run call:
VerifyNodaTime.Enable();
Then all Noda date/times will be scrubbed:
[Fact]
public Task ScrubbingExample()
{
var target = new Person
{
Dob = LocalDateTime.FromDateTime(DateTime.Now)
};
return Verifier.Verify(target);
}
Resulting in:
{
Dob: LocalDateTime_1
}
To disable scrubbing use DontScrubNodaTimes
:
[Fact]
public Task DisableExample()
{
var target = new Person
{
Dob = LocalDateTime.FromDateTime(new DateTime(2010, 2, 10))
};
return Verifier.Verify(target)
.DontScrubNodaTimes();
}
Resulting in:
{
Dob: 2010-02-10T00:00:00
}
Icon
Clock designed by Mooyai Khomsun Chaiwong from The Noun Project.