paint-brush
How to Manipulate DateTime in .NET to Help you Code Betterby@stphnwlsh

How to Manipulate DateTime in .NET to Help you Code Better

by Stephen Walsh3mJanuary 24th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Testing code that uses .NET's `DateTime.Now` sucks!!!! This is how to mock them, to properly validate DateTime when writing unit tests. The SimpleDateTimeProvider NuGet package is available on NuGet.org to help you with this in the future.
featured image - How to Manipulate DateTime in .NET to Help you Code Better
Stephen Walsh HackerNoon profile picture
Stephen Walsh

Stephen Walsh

@stphnwlsh

Hello! I’m a Husband, Father, Moustache Grower, Liverpool Fan, Software Engineer, Constant Learner and Team Leader.

About @stphnwlsh
LEARN MORE ABOUT @STPHNWLSH'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Stephen Walsh HackerNoon profile picture
Stephen Walsh@stphnwlsh
Hello! I’m a Husband, Father, Moustache Grower, Liverpool Fan, Software Engineer, Constant Learner and Team Leader.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite