How to write unit test for testing UriTemplates (e.g. [WebGet(Uritemlpate="{clientId}/returns")]in my WCF services?
For example, in Global.asax I have:
private void RegisterRoutes()
{
RouteTable.Routes.Add(new ServiceRoute("clients",
new WebServiceHostFactory(), typeof(ClientService)));
}
In ClientService, I have [WebGet(Uritemlpate="uri_1")]:
[ServiceContract]
public class ClientService
{
[WebGet(UriTemplate = "uri_1")]
public string GetCollection()
{
return "Method 1";
}
[WebGet(UriTemplate = "uri_2")]
public string GetCollections()
{
return "Method 2";
}
}
I want to have a test that claims the url clients/uri_1shows exactly the GetCollection ClientService method.
cDima source
share