Testing with Microsoft™ .NET objects
You can import serializable .NET objects from .NET assembly files (.exe or .dll) into HCL DevOps Test Integrations and APIs (Test Integrations and APIs) and apply them to messages in the same way as you would apply a schema. A service-based test or stub can then send and receive a message containing a serialized form of a .NET object from the assembly file. You can construct and parse the .NET objects and perform validation, but you cannot test the objects directly.
Test Integrations and APIs makes available as schema roots those classes that meet the following requirements:
- The class must be public.
- The class and all its references must be serializable, that is, marked with the [Serializable] attribute.
- The class must have a public no-argument constructor.
- The class must be instantiable.
- Public fields (primitive data types, single dimensional arrays, ArrayList, and List<>)
- Public properties
Note: A .NET object schema can be applied to byte array or string
fields. Byte array fields are serialized to binary format, and string fields are serialized to XML
format.
Requirements
Microsoft™ .NET Framework
If you want to use Test Integrations and APIs with .NET,
you must install the following software:
- Microsoft™ .NET Framework 4 or later (Microsoft™ .NET Framework Client Profile is different from the full version and does not meet the requirement)
- Microsoft™
Windows™ SDK for Windows™ 7 and .NET Framework 4 or laterNote: Some versions of Microsoft™ Windows™ do not support the .NET Framework. For information about supported operating systems, go to the Microsoft™ website.
Test Integrations and APIs DLL file
After installing the required .NET Framework software, you must add the
GHDotNetUtils.dll file to the global assembly cache (GAC). The
GHDotNetUtils.dll file is located in the root of the Test Integrations and APIs
installation directory.
Note: Sometimes, Test Integrations and APIs might
detect the GHDotNetUtils.dll file, but adding the file to the GAC ensures that
it will be detected by Test Integrations and APIs.