DateTimeTest
-
Bernie discovered a class named PspUntiTest. He could not see immediately what that was meant to test. Hence he opened it and found out:
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace PsPlayerViewModel.Tests { [TestClass] public class PspUnitTest { [TestMethod] public void DateTimeTest() { Assert.IsTrue(DateTime.Now.Date.CompareTo(DateTime.Today) == 0, "DT-Compare failed."); } } }
Congratulations, Kevin, you wrote a unit test!
-
@BernieTheBernie Hey, it's important to check your assumptions, and thanks to this test we know that the universe hasn't broken down.
However, better don't run it on 11:59 PM in case it might run
Now
andToday
just opposite of midnight...
-
@JBert said in DateTimeTest:
Hey, it's important to check your assumptions
I actually do have some unit tests for library functions. Because those libraries have changed assumptions over the years. Like libfmt with respect to number formatting.