Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with DateTime.Now #68

Open
MelbourneDeveloper opened this issue Oct 24, 2021 · 1 comment
Open

Issue with DateTime.Now #68

MelbourneDeveloper opened this issue Oct 24, 2021 · 1 comment

Comments

@MelbourneDeveloper
Copy link

MelbourneDeveloper commented Oct 24, 2021

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>.

@Miista
Copy link

Miista commented Jan 12, 2024

@MelbourneDeveloper What version of Pose were you using?

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

Please see my comment on #63

Miista added a commit to Miista/pose that referenced this issue Jan 25, 2024
Release v2.0 to NuGet

Version 2.0 supports the following targets:
* .NET Standard 2.0
* .NET Core 2.0
* .NET Core 3.0
* .NET Framework 4.8
* .NET 7
* .NET 8

Version 2.0 fixes the following issues:
* tonerdo/pose#17
* tonerdo/pose#37
* tonerdo/pose#38
* tonerdo/pose#41
* tonerdo/pose#47
* tonerdo/pose#49
* tonerdo/pose#60
* tonerdo/pose#67
* tonerdo/pose#68
* tonerdo/pose#70
* tonerdo/pose#71
* tonerdo/pose#72
* tonerdo/pose#75
* tonerdo/pose#79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants