Note that there are some explanatory texts on larger screens.

plurals
  1. POI Tried do a simple unit testing in mvc 2 but it throws this error .Can any one Help me
    primarykey
    data
    text
    <p>I have to do a unit test for one method or function in MVC 2 .It will work on windows application ,But it shows the following Error Message in mvc2 can any one help me please</p> <p>The Web request 'LocalHost' completed successfully without running the test. This can occur when configuring the Web application for testing fails (an ASP.NET server error occurs when processing the request), or when no ASP.NET page is executed (the URL may point to an HTML page, a Web service, or a directory listing). Running tests in ASP.NET requires the URL to resolve to an ASP.NET page and for the page to execute properly up to the Load event. The response from the request is stored in the file 'WebRequestResponse_HelloTest.html' with the test results; typically this file can be opened with a Web browser to view its contents.</p> <p>here is my code Below</p> <p>Home Controller:</p> <pre><code> public string Hello() { return "This is my First Unit Testing"; } </code></pre> <p>After that Right Click the controller , select the specified method and done a unit testing.</p> <p>Here the testing Code below HomeControllerTest.cs</p> <pre><code> [TestMethod()] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("C:\\Users\\user\\Desktop\\praveen\\adcd\\adcd", "/")] [UrlToTest("http://localhost:50332/")] public void HelloTest() { HomeController target = new HomeController(); // TODO: Initialize to an appropriate value string expected = "This IS my First Unit Testing"; // TODO: Initialize to an appropriate value string actual; actual = target.Hello(); Assert.AreEqual(expected, actual); // Assert.Inconclusive("Verify the correctness of this test method."); } TestFiles: WebRequestResponse_HelloTest.html </code></pre> <p>Finally I got a answer once i removed a [HostType("ASP.NET")] it will check my string and show the success message.Dont know how it works nu.Thanks for your effort to analyse my bug. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload