c# - Unit testing asp.net mvc4 with Entity Framework -
the web request 'url test' completed without running test.
this error can passed not calling asp server; commenting out lines between testmethod , createtest. next error?
system.argumentexception: specified named connection either not found in configuration, not intended used entityclient provider, or not valid.
the app config file in test project has no connections. tried inserting relavant connection strings , copied project web.config main project, still error?! have researched threads indicate half utilize sort of false database? true; if point me
[testmethod()] [hosttype("asp.net")] [aspnetdevelopmentserverhost("c:\\users\\admin\\documents\\visual studio 2010\\projects\\ca3 ead\\ca3 ead", "/")] [urltotest("http://localhost:2124/")] public void createtest() { employeecontroller target = new employeecontroller(); // todo: initialize appropriate value employee employee = new employee(); // todo: initialize appropriate value //employee.name = "test"; //employee.surname = "test"; //employee.town = "test"; ; //employee.county = "test"; //employee.country = "test"; //employee.gradeid = 4; //actionresult expected = target.create(); // todo: initialize appropriate value //actionresult actual = null; var expected = target.create(); var actual = target.create(employee); //assert.areequal(expected, actual); //assert.inconclusive("verify correctness of test method."); }
this has plagued long time , quite controversial issue.
fake dbcontext of entity framework 4.1 test
see answers such above.
c# visual-studio-2010 unit-testing asp.net-mvc-4 entity-framework-5
No comments:
Post a Comment