pose
pose copied to clipboard
Common Language Runtime detected an invalid program.
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.
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