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

Common Language Runtime detected an invalid program. #60

Open
kristof12345 opened this issue Apr 23, 2020 · 1 comment · May be fixed by Miista/pose#29
Open

Common Language Runtime detected an invalid program. #60

kristof12345 opened this issue Apr 23, 2020 · 1 comment · May be fixed by Miista/pose#29

Comments

@kristof12345
Copy link

Hi!

I get an excepion when running my tests:
System.InvalidProgramException : Common Language Runtime detected an invalid program.

My test is:
// Set DateTime.Now
Shim dateTimeShim = Shim.Replace(() => DateTime.Now).With(() => new DateTime(2020, 1, 1).AddHours(1));

        PoseContext.Isolate(async () =>
        {
            Assert.Equal(new DateTime(2020, 1, 1).AddHours(1), DateTime.Now);

            var result = await Repository.IncrementVotes();
            Assert.Equal(1, result);

            result = await Repository.IncrementVotes();
            Assert.Equal(2, result);

            result = await Repository.CountVotes();
            Assert.Equal(2, result);
        }, dateTimeShim);

Thanks.

@viceice viceice mentioned this issue Jul 1, 2020
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
@Miista
Copy link

Miista commented Jan 27, 2024

@Miista Miista linked a pull request Jan 28, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants