Open Driedas opened 2 years ago
@Driedas I just realised that I posted exactly the same issue
@MelbourneDeveloper yeah, probably going to get as much feedback as me :-)
Anyway, I've worked around it the same way I do usually, introduce an additional DateTime input parameter into the relevant method, which works just as well. I just wanted to give this a try when I saw it... There's other options, like introducing something like an IClock with a default implementation that just calls into DateTime.UtcNow
Would love to see this resolved. To me, using a library like Pose is the correct way to test for DateTime (though likely against the thoughts of OOP purists). Feedback / community seems like a bit of a ghost town though, wonder where I can pitch in if at all...
There's also a general problem with async / await code that appears to be unresolved
@Driedas @princefishthrower Please see my comment on #63
@princefishthrower For support for async/await please see https://github.com/Miista/pose/issues/12
Hi, I've stumbled upon this project looking for exactly this feature for unit testing DateTime.UtcNow (without having to resort to 3rd party libraries like NodaTime etc), have cloned the repository and added the following unit test, based on the documentation
The result I get is a fail however, with the message
Am I doing something wrong here? The unit test suite that comes with the project is all green, however the above should work as well, according to my understanding...