Skip to content

Commit

Permalink
Merge pull request #167 from glhays/users/glhays/acceptance-webassemb…
Browse files Browse the repository at this point in the history
…ly-tests

ACCEPTANCE: WebAssembly `WireMock` Tests
  • Loading branch information
hassanhabib authored Mar 9, 2024
2 parents 24d6aba + baea415 commit fc69505
Show file tree
Hide file tree
Showing 17 changed files with 1,928 additions and 105 deletions.
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

0 comments on commit fc69505

Please # to comment.