От: | Ellin | www.rsdn.ru | |
Дата: | 18.03.10 11:36 | ||
Оценка: |
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[TestMethod()]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("... здесь путь к файлу на диске. студия автоматом поставила.", "/")]
[UrlToTest("http://localhost:2336/")]
public void HelloWorldTest()
{
Service1 target = new Service1(); // TODO: Initialize to an appropriate value
string expected = "Hello World1"; // только это поменял, но не в этом суть...
string actual;
actual = target.HelloWorld();
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
The Web request 'http://localhost:2336/' 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_HelloWorldTest.html' with the test results; typically this file can be opened with a Web browser to view its contents.