InterviewSolution
Saved Bookmarks
| 1. |
Example Of Web Service Test Method? |
|
Answer» This is a SIMPLE test method that tests the HelloWorld() WEB method of a Web service: USING Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.Web; using TestProject1.localhost; [TestMethod] [AspNetDevelopmentServer("HelloWorldServer", @"C:Documents and SettingsuserMy DocumentsVisual Studio 2005 WebSitesWebSite1")] public void HelloWorldTest() { HelloWorldService TARGET = new HelloWorldService(); Assert.IsTrue( WebServiceHelper.TryUrlRedirection ( target, testContextInstance, "HelloWorldServer" ), "Web service redirection FAILED." ); string expected = "Hello World"; string actual; actual = target.HelloWorld(); Assert.AreEqual( expected, actual, "TestProject1.localhost.HelloWorldService.HelloWorld did not return the expected value." ); }This is a simple test method that tests the HelloWorld() Web method of a Web service: |
|