using Endpoint; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace EndpointTest { /// /// Functional Tests for SoapEndpoint /// [TestClass] public class SoapEndpointTest { // Random internet webservice private const string URISTRING = @"http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"; private const string SOAPACTION = @"http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#GmlTimeSeries"; private const string SOAPREQUEST = @"" + @" " + @" " + @" " + @" ?" + @" ?" + @" ?" + @" ?" + @" ?" + @" ?" + @" " + @" " + @""; private const string XPATHNAMESPACES = @"a,http://www.opengis.net/ows"; private const string XPATHQUERY = @"//a:Exception[1]/@ExceptionText"; private const string EXPECTEDXPATHRESULT = @"VERSION key not found"; /// /// Runs GetStatus /// [TestMethod] public void GetStatusTest() { var target = new SoapEndpoint { UriString = URISTRING, XpathQuery = XPATHQUERY, ExpectedXpathResult = EXPECTEDXPATHRESULT, SoapAction = SOAPACTION, SoapRequest = SOAPREQUEST, XpathNamespaces = XPATHNAMESPACES }; var status = target.GetStatus(); Assert.AreEqual(Status.Up, status); } } }