pose icon indicating copy to clipboard operation
pose copied to clipboard

Common Language Runtime detected an invalid program.

Open kristof12345 opened this issue 5 years ago • 1 comments

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.

kristof12345 avatar Apr 23 '20 10:04 kristof12345

For support for async/await please see https://github.com/Miista/pose/issues/12

cc: @madmox @mql4coder @karlfinnsson @misskaseyann @jmoralesv @lewis-hu @inqb @TakaGoto @tsawyer999 @josh-hoiland

Miista avatar Jan 27 '24 20:01 Miista