-
Notifications
You must be signed in to change notification settings - Fork 234
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
Fix/numeric provider state param #506
base: master
Are you sure you want to change the base?
Changes from all commits
d4b105b
34e66e0
7d5560d
0996c4e
08561f9
93abcbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using System; | ||
using PactNet.Interop; | ||
|
||
using System.Text.Json.Serialization; | ||
namespace PactNet.Drivers | ||
{ | ||
/// <summary> | ||
|
@@ -37,8 +37,11 @@ public void Given(string description) | |
/// <param name="name">Parameter name</param> | ||
/// <param name="value">Parameter value</param> | ||
/// <returns>Success</returns> | ||
public void GivenWithParam(string description, string name, string value) | ||
=> NativeInterop.GivenWithParam(this.interaction, description, name, value).CheckInteropSuccess(); | ||
public void GivenWithParam(string description, string name, object value) | ||
{ | ||
var jsonValue = System.Text.Json.JsonSerializer.Serialize(value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Don't use var when it's not obvious what the type is style: Don't use fully qualified references inline, use an import instead |
||
NativeInterop.GivenWithParam(this.interaction, description, name, jsonValue).CheckInteropSuccess(); | ||
} | ||
|
||
/// <summary> | ||
/// Add a request to the interaction | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using PactNet.Interop; | ||
|
||
using System.Text.Json.Serialization; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Blank line after import statements |
||
namespace PactNet.Drivers | ||
{ | ||
/// <summary> | ||
|
@@ -34,8 +34,11 @@ public void Given(string description) | |
/// <param name="description">Provider state description</param> | ||
/// <param name="name">Parameter name</param> | ||
/// <param name="value">Parameter value</param> | ||
public void GivenWithParam(string description, string name, string value) | ||
=> NativeInterop.GivenWithParam(this.interaction, description, name, value).CheckInteropSuccess(); | ||
public void GivenWithParam(string description, string name, object value) | ||
{ | ||
var jsonValue = System.Text.Json.JsonSerializer.Serialize(value); | ||
NativeInterop.GivenWithParam(this.interaction, description, name, jsonValue).CheckInteropSuccess(); | ||
} | ||
|
||
/// <summary> | ||
/// Set the description of the message interaction | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is a breaking change to the public API