Comments (3)
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.
from pose.
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"
from pose.
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.
from pose.
Related Issues (20)
- Houston is anyone there? HOT 4
- how to shim a constructor with parameters?
- Offer to make public Shim constructor HOT 1
- Pose not compatible with Code Coverage tools?
- Can we use Pose with Moq?
- Common Language Runtime detected an invalid program. HOT 1
- Async-await HOT 3
- Reviving this project HOT 16
- Question : Make my function throw an exception
- shim for DateTime.UtcNow not working HOT 5
- Issue with DateTime.Now HOT 1
- Bug with a test app
- Issue with .Net static methods like File.Exists
- .NET 6.0 HOT 1
- Static methods doesen't work HOT 3
- ShimHelper.ValidateReplacementMethodSignature has ambiguous and vague output that does not help with debugging
- Stack Overflow when trying to use shim from task HOT 1
- Is this library Dead? HOT 1
- Mono Dependencies out of date.
- Issue with NET7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pose.