I tried timeouts and throwing exceptions in the service implementation, but it didn't caused the channel to enter a faulty state as it happens in my production code.
How could I force this event to happen for testing purposes?
The following code throws an exception for the first request, making it fail, but the subsequent requests succeed (unfortunately, since my objective is to make them fail)
public class SampleService : ISampleService
{
static bool first = true;
SampleData ISampleService.SampleMethod(SampleData data)
{
if (first)
{
first = false;
throw new Exception();
}
return data;
}
}