Prig icon indicating copy to clipboard operation
Prig copied to clipboard

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

Open texavery77 opened this issue 7 years ago • 1 comments

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?

texavery77 avatar Jul 06 '18 08:07 texavery77

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

JRallee avatar Jul 17 '18 10:07 JRallee