Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking not working at all under VS 2015 Professional (Windows 7 Pro SP1) #101

Open
texavery77 opened this issue Jul 6, 2018 · 1 comment

Comments

@texavery77
Copy link

texavery77 commented Jul 6, 2018

I followed the quickstart instructions exactly, trying to mock DateTime.Now from a simple Console application (based on .NET 4.6.1), but the actual mocking just does not take place, I always get the real date from DateTime.Now without getting any errors (that might give a hint that some critical part is missing).

            {
                PDateTime.NowGet().Body = () => new DateTime();

                var x = DateTime.Now;

                // always outputs real date/time
                System.Console.WriteLine("Time: " + x.ToString("G")); 
                System.Console.ReadLine();
                return;
            }

Am I missing something something important?

@JRallee
Copy link

JRallee commented Jul 17, 2018

Hi,

I am facing the same issue. The test does not use the mocked values at all :(

Also to add, the Urasandesu.* dlls were not added automatically, I had to search and track it in Program data folder and add it manually. Maybe, something went wrong in installation?

Some help would be really nice.
Note: Running MSTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants