Comments (7)
My workaround, using the above example:
Assert.That(LastDateAccessed, Is.InRange(beforeUpdate - TimeSpan.FromSeconds(1), beforeUpdate + TimeSpan.FromSeconds(1)));
But it's less elegant or intuitive.
from nunit.
@RenderMichael The ComparisonConstraint
does seem to have support for Within
, it might just be that it doesn't work on DateTime
. The special time suffixes are only on the EqualsConstraint
. Maybe those need to be move up to its base class. It also looks like the Tolerance.LinearRange
doesn't handle this.
Feel free to work on this to make it more consistent with IsEqualTo
.
from nunit.
Opened PR #4618
from nunit.
Related Issues (20)
- Feature request: Assert.Multiple() could return an IDisposable, avoiding passing an Action around. HOT 15
- Assert.ThatAsync doesn't seem to work with ValueTask HOT 6
- Exception when using test filters from .runsettings or --filter argument from dotnet test HOT 25
- Add AsyncEnumerable and AsyncDisposal support for Asserts
- Parameter count mismatch with indexer HOT 4
- VS 2022 Test Explorer shows tests multiple times HOT 1
- Also alllow TemplateBased naming (for arguments etc.) placeholders in test description HOT 3
- Internal inconsistency in NUnitTestAssemblyRunner
- DefaultTimeout in .runsettings + TearDown method seems to break test output HOT 8
- TestCaseSource is ingored when different main namespace than the others HOT 3
- Executing Tests in a dedicated thread with a proper Dispatcher HOT 2
- WpfMessagePumpStrategy - change from Dispatcher.Run to Dispatcher.PushFrame HOT 3
- PropertiesComparer should have default Depth limit, and compare breadth first, to reduce chances of StackOverflow HOT 6
- GitHub Actions fail on `master` for Windows and Linux builds HOT 6
- EqualTo() gives wrong result HOT 4
- Making `Constraint.Description` abstract breaks backwards compatibility HOT 5
- Question: Namespace Level Parallelization HOT 1
- Support for the new test runner HOT 3
- Can you please give us back `Assert.IsNotNull`, `Assert.IsFalse` etc.? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nunit.