Skip to content
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

ACCEPTANCE: WebAssembly WireMock Tests #167

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions RESTFulSense.WebAssembly/Clients/IRESTFulApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ namespace RESTFulSense.WebAssembly.Clients
{
public interface IRESTFulApiClient
{
ValueTask<T> GetContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);
ValueTask<T> GetContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> GetContentAsync<T>(
string relativeUrl,
CancellationToken cancellationToken,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<string> GetContentStringAsync(string relativeUrl);

ValueTask<Stream> GetContentStreamAsync(string relativeUrl);

ValueTask PostContentWithNoResponseAsync<T>(
Expand Down Expand Up @@ -87,6 +91,15 @@ ValueTask<T> PutContentAsync<T>(
Func<T, ValueTask<string>> serializationFunction = null,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> PutContentAsync<T>(
string relativeUrl,
T content,
CancellationToken cancellationToken,
string mediaType = "text/json",
bool ignoreDefaultValues = false,
Func<T, ValueTask<string>> serializationFunction = null,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<TResult> PutContentAsync<TContent, TResult>(
string relativeUrl,
TContent content,
Expand All @@ -104,16 +117,24 @@ ValueTask<TResult> PutContentAsync<TContent, TResult>(
Func<TContent, ValueTask<string>> serializationFunction = null,
Func<string, ValueTask<TResult>> deserializationFunction = null);

ValueTask<T> PutContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);
ValueTask<T> PutContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> PutContentAsync<T>(
string relativeUrl,
CancellationToken cancellationToken, Func<string,
ValueTask<T>> deserializationFunction = null);

ValueTask DeleteContentAsync(string relativeUrl);
ValueTask DeleteContentAsync(string relativeUrl, CancellationToken cancellationToken);
ValueTask<T> DeleteContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask DeleteContentAsync(
string relativeUrl,
CancellationToken cancellationToken);

ValueTask<T> DeleteContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> DeleteContentAsync<T>(
string relativeUrl,
Expand Down
22 changes: 17 additions & 5 deletions RESTFulSense.WebAssembly/Clients/IRESTFulApiFactoryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ namespace RESTFulSense.WebAssembly.Clients
{
public interface IRESTFulApiFactoryClient
{
ValueTask<T> GetContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);
ValueTask<T> GetContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> GetContentAsync<T>(
string relativeUrl,
CancellationToken cancellationToken,
Expand Down Expand Up @@ -104,19 +107,28 @@ ValueTask<TResult> PutContentAsync<TContent, TResult>(
Func<TContent, ValueTask<string>> serializationFunction = null,
Func<string, ValueTask<TResult>> deserializationFunction = null);

ValueTask<T> PutContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);
ValueTask<T> PutContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> PutContentAsync<T>(
string relativeUrl,
CancellationToken cancellationToken,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask DeleteContentAsync(string relativeUrl);
ValueTask DeleteContentAsync(string relativeUrl, CancellationToken cancellationToken);
ValueTask<T> DeleteContentAsync<T>(string relativeUrl, Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask DeleteContentAsync(
string relativeUrl,
CancellationToken cancellationToken);

ValueTask<T> DeleteContentAsync<T>(
string relativeUrl,
Func<string, ValueTask<T>> deserializationFunction = null);

ValueTask<T> DeleteContentAsync<T>(
string relativeUrl,
CancellationToken cancellationToken,
Func<string, ValueTask<T>> deserializationFunction = null);
}
}
}
Loading
Loading