Problems with WCF Load Test and inherited classes

Sep 11, 2008 at 2:12 PM
Hi,

We are using WCF Load Test in out project in order to perform application load test. We hope this tool will be very useful for us, congratulations to the authors. However, up to date, we have some problems in the unit test generation that is related to inherited classes in the parameters. I explain it with the following sample:

We have a service operation with a parameter, for instance:

    void ServiceOperation(Shape Parameter)

On the other hand, the client of this service invokes this service operation using a derived class of the parameter type. For instance:

    ServiceOperation(new Circle());

      where:

    class Circle : Shape
    {
        ...

Then, we run the application into the WCF Load Test wizard and, when we press finish in order to create the unit test, we have the following error:

    Expected object of type Shape, but was of type Circle

We already include a KnowType tag in configuration file as the following sample (in other case, we have other error message saying that it is necessary include an knownType):

    ...
    <add type="Shape, AssemblyName...">
        <knownType type="Circle, AssemblyName...">
    </add>

    ...

¿Somebody knows how we can solve this problem?

Thanks in advantage and best regards,
Juan


Coordinator
Sep 16, 2008 at 4:47 PM
The tool does not cover this scenario. I will take a look.
Coordinator
Sep 16, 2008 at 5:45 PM
Here is a temporary fix you can make:

Edit objectgenerator.cs. Find the method CheckAndMapExpectedType. At the end of the method, replace the code that throws the exception with the following:

ans = o.GetType();