Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Unit testing a Service dotNet rule

Updated on April 5, 2022

Use the unit testing feature to verify that the operations of a Service dotNet rule function correctly before you add the external client to your testing process.

Important: Service dotNet rules are no longer being actively developed, and are being considered for deprecation in upcoming releases. Using Service dotNet rules does not follow Pega development best practices. Use Service SOAP rules instead. For more information, see Service SOAP rules.

Unit testing provides only partial evidence of a correct implementation. For more comprehensive information on testing services, see Testing Services and Connectors, a document on the Integration pages of the Pega Community.

To run a unit test, complete the following steps:

  1. Save the rule form.
  2. Start the Tracer by clicking Actions > Trace. For more information, see Tracing services.
  3. Click Actions > Run.
  4. Complete the form as described in the following table, and then click Execute.
FieldDescription
Requestor Context Select a radio button to define the requestor session is to be used in the test:
  • Use current requestor context — Use your requestor session (including your RuleSet list, privileges, and current clipboard)
  • Initialize service requestor context — Create a new requestor session based on the APP requestor type and, if the service package requires authentication, another Operator ID instance.

Authentication User IDIf you selected Initialize service requestor context , and the service package instance for the service requires authentication, enter the Operator ID to be used to test the service
Authentication PasswordIf you selected Initialize service requestor context , and the service package instance for the service requires authentication, enter a password for the Operator ID.
Enter Request Data Select a radio button to define the source of request data values for this test:
  • Specify individual request values — This option appears only when all elements of the message are simple text values not objects or complex values of type XML Page.
  • Supply SOAP Envelope — You provide the entire SOAP message including the header.

SOAP Header ValuesIf you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Header Field row on the Request tab. Enter a value that matches the XSD type shown.
SOAP Parameter ValuesIf you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Request Parameters row listed on the Request tab. Enter a value that corresponds to the XSD data type shown.
SOAP Request Envelope If you selected Supply Soap Envelope , enter or paste a well-formed and valid XML document in the SOAP Request Envelope text area, starting with the <?xml version="1.0"> declaration.

If the service expects requests containing an array element or XML Page elements, a skeleton document is provided as a starting point.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us