-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match.Type throws an exception on an attribute of type Object #503
Comments
Please could you attach the full verifier output log? Generally speaking using object types is going to cause problems because the serialisation round trip might not have the appropriate type information to know how to deserialise the JSON in the pact file properly when verifying. Seeing the full logs will probably cast some light on that though. |
Thanks. This is all I seem to find: MessageContract.Tests.GainEventProcessorTests.ReceiveSomeStockEvents Message: With configuration:
|
@lacajenne You may need to enable the xUnit output in the |
Version information:
Describe the bug
We are writing consumer tests for an event-driven system.
The Match.Type method, when working on an attribute of type Object, throws an exception with this error message:
---- Expected property events[0].Data to be a dictionary or collection of key-value pairs that is keyed to type System.String. It implements .
Steps To Reproduce
Write a consumer test validating an object belonging to a class like the following
public sealed class TestDataClass
{
public WorkflowReference WorkflowReference { get; set; }
public string Title { get; set; }
public object Data { get; set; }
}
Expected behavior
It is possible to invoke Match.Type on the Data attribute.
Log Output
Stack Trace:
ConfiguredMessageVerifier.Verify[T](Action
1 handler) GainEventProcessorTests.ReceiveSomeStockEvents() line 120 RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) ----- Inner Stack Trace ----- XUnit2TestFramework.Throw(String message) TestFrameworkProvider.Throw(String message) CollectingAssertionStrategy.ThrowIfAny(IDictionary
2 context)AssertionScope.Dispose()
EquivalencyValidator.AssertEquality(Comparands comparands, EquivalencyValidationContext context)
GenericCollectionAssertions
3.BeEquivalentTo[TExpectation](IEnumerable
1 expectation, Func2 config, String because, Object[] becauseArgs) GenericCollectionAssertions
3.BeEquivalentTo[TExpectation](IEnumerable1 expectation, String because, Object[] becauseArgs) <>c__DisplayClass2_0.<ReceiveSomeStockEvents>b__5(ICollection
1 events) line 127ConfiguredMessageVerifier.Verify[T](Action`1 handler)
The text was updated successfully, but these errors were encountered: