2013-02-15 41 views
0

这个简单的生成单元测试呼叫控制器“太多的自动重定向”错误MVC单元测试

[TestMethod()] 
    [HostType("ASP.NET")] 
    [AspNetDevelopmentServerHost("E:\\Backup\\Proyecto", "/Proyecto")] 
    [UrlToTest("http://localhost:40053/Proyecto/")] 
    public void BatchUpdateTest() 
    { 
     FacturaController target = new FacturaController(); // TODO: Initialize to an appropriate value 
     Factura Factura = null; // TODO: Initialize to an appropriate value 
     JsonResult expected = null; // TODO: Initialize to an appropriate value 
     JsonResult actual; 
     actual = target.BatchUpdate(Factura); 
     Assert.AreEqual(expected, actual); 
     Assert.Inconclusive("Verify the correctness of this test method."); 
    } 

但抛出我这个错误:

"Could not connect to the Web server for page 'localhost:40053/Proyecto'. Too many automatic redirections were attempted.. Check that the Web server is running and visible on the network and that the page specified exists."

我可以连接到集成的Web服务器与Visual Studio的浏览器

与此相关,但不帮我:"too many automatic redirections were attempted" error message when using a httpWebRequest in .NET

我应该保存饼干吗?

+0

什么是你的问题?你能否给出更多的背景知识,你为达到这种行为而采取的步骤以及你期望的行为?有关部件的一些小代码也可以帮助我们诊断您的问题。 – 2013-02-15 14:22:19

回答

0

只是删除了TestMethod的声明之后的变质剂和它的工作:

[TestMethod()] 
public void BatchUpdateTest() 
{ 
... 
}