Skip to content

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

Open
@texavery77

Description

@texavery77

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions