pose icon indicating copy to clipboard operation
pose copied to clipboard

Issue with DateTime.Now

Open MelbourneDeveloper opened this issue 4 years ago • 1 comments

I'm trying to get a basic sample working and I'm having difficulties. So, I added this test case to the existing unit tests:

[TestMethod]
public void TestReplace2()
{
    var expected = new DateTime(1999, 12, 31, 23, 59, 59);
    DateTime? actual = null;
    PoseContext.Isolate(() =>
    actual = DateTime.Now, Shim.Replace(() => DateTime.Now).
            With(() => expected));
    Assert.AreEqual(expected, actual.Value);
}

This fails. Am I doing something wrong, or is this a bug?

Assert.AreEqual failed. Expected:<31/12/1999 11:59:59 PM>. Actual:<25/10/2021 7:41:25 AM>.

MelbourneDeveloper avatar Oct 24 '21 20:10 MelbourneDeveloper

@MelbourneDeveloper What version of Pose were you using?

As mentioned in tonerdo/Pose#79 there is a bug in versions above 1.1.0. Please see my comment there.

Please see my comment on #63

Miista avatar Jan 12 '24 13:01 Miista