Open BermudaLamb opened 5 years ago
You're mocking Console.WriteLine(string). However you're providing a DateTime to the Console.WriteLine class. I expect this will call Console.WriteLine(object). It basically means you have to mock that one.
This is a near direct copy of the README example on the primary page .. According to that:
// Outputs "Hijacked: Hello World!"
Console.WriteLine("Hello World!");
// Outputs "4/4/04 12:00:00 AM"
Console.WriteLine(DateTime.Now);
Even though it is within my PoseContext.Isolate() the string writing is working as expected. However, the shim for the DateTime is returning a junk date, rather than the expected "4/4/04 12:00:00 AM"
what happens if you construct the datetime in the shim? I think there may be a memory access issue when you use a variable from outside a shim.
Test is returning: 4/18/D1935668524 3:40:45 AM