Skip to content

Common Language Runtime detected an invalid program. #60

Open
Miista/pose
#29

Description

@kristof12345

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.

Activity

  1. added a commit that references this issue on Jan 25, 2024
  2. Miista commented on Jan 27, 2024

    @Miista
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions