Files
Lluis Sanchez 6bf582e92d * WebServiceTest.cs, client/external/BankCodeEJBHomeTest.cs,
client/external/GlobalWeatherTest.cs, client/external/HPcatalogTest.cs,
	  client/external/IODCODESPOSTAUXTest.cs,
	  client/external/TemperatureServiceTest.cs,
	  client/localhost/DataServiceTest.cs,
	  client/localhost/DuplicateArrayTestTest.cs,
	  client/localhost/IncludeTestTest.cs,
	  client/localhost/TestBinding4Test.cs: Use new nunit 2.2 api.

	* server/ConvDocLitWra.asmx, server/ConvDocEncWra.asmx,
	  server/ConvDocLitBar.asmx, server/ConvDocLitWra.asmx,
	  server/ConvRpc.asmx,

	* wstest.cs: Added support for generating tests cases from a template.
	  Useful to test the same case in all formats and protocols.

	* proxies.net.xml.gz, wsdlfiles.tar.gz: Updated.

	* client/localhost/ConvDocEncBarTest.cs,
	  client/localhost/ConvDocLitBarTest.cs,
	  client/localhost/ConvDocLitWraTest.cs,
	  client/localhost/ConvRpcTest.cs,
	  client/localhost/ConvDocEncBar.asmx:
	  Improved tests. Use new nunit 2.2 api.

	* Conv.cs.template: template for ConverterService client tests.

	* Conv.asmx.template: template for ConverterService services.

	* templates.xml: Configuration file for generating the tests.

svn path=/trunk/mcs/; revision=30621
2004-07-01 14:04:31 +00:00

42 lines
1.0 KiB
C#

// Web service test for WSDL document:
// http://localhost:8080/DataService.asmx?wsdl
using System;
using System.Data;
using NUnit.Framework;
using DataServiceTests.Soap;
//using DataServiceTests.HttpGet;
//using DataServiceTests.HttpPost;
namespace Localhost.DataServiceTests
{
[TestFixture]
public class DataServiceTest: WebServiceTest
{
[Test]
public void TestService ()
{
DataService service = new DataService ();
DataSet dset = service.QueryData ("some query");
DataTable t = dset.Tables["PhoneNumbers"];
Assert.IsNotNull (t, "#1");
Assert.AreEqual (2, t.Rows.Count, "#2");
DataRow row = t.Rows[0];
Assert.AreEqual ("Lluis", row["name"], "#3");
Assert.AreEqual ("23452345", row["home"], "#4");
row = t.Rows[1];
Assert.AreEqual ("Pep", row["name"], "#5");
Assert.AreEqual ("435345", row["home"], "#6");
DataRow newRow = t.NewRow();
newRow["name"] = "Pau";
newRow["home"] = "9028374";
t.Rows.Add (newRow);
int n = service.SaveData (dset);
Assert.AreEqual (3, n, "#7");
}
}
}