Testcases to test webmethods  
Author Message
Savindra





PostPosted: ASMX Web Services and XML Serialization, Testcases to test webmethods Top

Hai

I am having bunch of webmethods, I has to test each and every webmethod by passing different parameters by making a windows console application, I don't know how to test the methods, can you help me by giving advices and examples/links where I can found them. I need like these test cases more.

public class Program

{

static void Main(string[] args)

{

RelationsNet _service = null;

_service = new RelationsNet();

_service.Url = "-----"

TestService srvc = new TestService();

srvc._service = _service;

srvc.TestGetRelationType();

Console.ReadKey();

}

}

public class TestService

{

public RelationsNet _service = null;

public void TestGetRelationType()

{

string typedef = _service.GetRelationTypeDefinition("Friend");

if (typedef != null && typedef.Length > 0)

{

// Validate return string

// Log result as success.

System.Diagnostics.Debug.WriteLine(typedef); ;

}

}

Thanks,

Savindra.



.NET Development15  
 
 
Dennis Stone - MSFT





PostPosted: ASMX Web Services and XML Serialization, Testcases to test webmethods Top

VS Team System for Testers provides functionality that would work well for this, you can find more information about that here: http://msdn.microsoft.com/vstudio/teamsystem/tester/

To do this from a console application you'll first need a datasource that contains all of your inputs and the expected output then you can go through your datasource row by row and call your web method with that input and validate the actual output against the expected output and log the results to someplace you can easily review them when the test has completed.