Click here to Skip to main content
15,900,325 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I have created a ASP.net vnext class library project in Visual Studio 2015. Now I want to test my project. So, I want to use mocking stuffs in my test project. Here is my project.json file

C#
{
    "version": "1.0.0-*",
    "dependencies": {
        "xunit": "2.0.0-rc3-build2880",
        "xunit.runner.aspnet": "2.0.0-rc3-build52",
          "My project name with version",
           "Moq": "4.2.1502.911"     
    },

    "commands": { "test": "xunit.runner.aspnet" },

    "frameworks": {
        "aspnet50": {
            "dependencies": {             

            }
        }

    }
    }

But I am getting error :Dependency Moq with the Version 4.2.1502.911 could not be resolved.

I also tried different version of Moq, but results the same: dependency error.
Without Mock I can't move further in testing.

Any help?
Posted
Updated 30-Mar-15 6:03am
v3
Comments
Sergey Alexandrovich Kryukov 23-Mar-15 17:05pm    
Help with what? This is not a question. Anything else is off-topic on this forum.
—SA
RajKumar Mondal 30-Mar-15 12:10pm    
I have improved my question so please take a look.
RajKumar Mondal 23-Mar-15 17:23pm    
steps to create mock in xunit testing in vnext class library project.
I have a class LoggerModule and a constructor with a parameter,

public LoggerModule(ILogger logger) {
_logger = logger;
}
I want to bypass this method and use other method of LoggerModule class and perform testing with it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900