Skip to content

Commit

Permalink
CODE RUB: Rename Tests restfulApiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
glhays committed Mar 8, 2024
1 parent 224e890 commit b22d189
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private async Task ShouldDeleteContentAsync()
.WithStatusCode(200));

// when . then
await this.restfulApiClient.DeleteContentAsync(
await this.restfulWebAssemblyApiClient.DeleteContentAsync(
relativeUrl: relativeUrl);
}

Expand All @@ -44,7 +44,7 @@ private async Task ShouldDeleteContentCancellationTokenAsync()
.WithStatusCode(200));

// when . then
await this.restfulApiClient.DeleteContentAsync(
await this.restfulWebAssemblyApiClient.DeleteContentAsync(
relativeUrl: relativeUrl,
cancellationToken: cancellationToken);
}
Expand All @@ -66,7 +66,7 @@ private async Task ShouldDeleteContentReturnsExpectedContentDeserializeAsync()

// when
TEntity actualDeletedTEntity =
await this.restfulApiClient.DeleteContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.DeleteContentAsync<TEntity>(
relativeUrl: relativeUrl,
deserializationFunction: DeserializationContentFunction);

Expand All @@ -92,7 +92,7 @@ private async Task ShouldDeleteContentReturnsExpectedContentCancellationTokenAsy

// when
TEntity actualDeletedTEntity =
await this.restfulApiClient.DeleteContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.DeleteContentAsync<TEntity>(
relativeUrl: relativeUrl,
cancellationToken: cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private async Task ShouldGetContentWithDeserializationFunctionAsync()

// when
TEntity actualTEntityEntity =
await this.restfulApiClient.GetContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.GetContentAsync<TEntity>(
relativeUrl: relativeUrl,
deserializationFunction: DeserializationContentFunction);

Expand All @@ -56,7 +56,7 @@ private async Task ShouldCancelGetContentDeserializationIfCancellationInvokedAsy
// when
TaskCanceledException actualCanceledTask =
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
await this.restfulApiClient.GetContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.GetContentAsync<TEntity>(
relativeUrl: relativeUrl,
cancellationToken: taskCancelInvoked,
deserializationFunction: DeserializationContentFunction));
Expand All @@ -79,7 +79,7 @@ private async Task ShouldReturnStringOnGetContentStringAsync()

// when
string actualContent =
await this.restfulApiClient.GetContentStringAsync(relativeUrl);
await this.restfulWebAssemblyApiClient.GetContentStringAsync(relativeUrl);

// then
actualContent.Should().BeEquivalentTo(someContent);
Expand All @@ -99,7 +99,7 @@ private async Task ShouldReturnStreamOnGetContentStreamAsync()

// when
Stream expectedContentStream =
await this.restfulApiClient.GetContentStreamAsync(
await this.restfulWebAssemblyApiClient.GetContentStreamAsync(
relativeUrl: relativeUrl);

string actualReadStream =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private async Task ShouldPostContentWithNoResponseAndDeserializeContentAsync()

// when
Action actualResponseResult = async () =>
await this.restfulApiClient.PostContentWithNoResponseAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PostContentWithNoResponseAsync<TEntity>(
relativeUrl: relativeUrl,
content: inputTEntity,
mediaType: mediaType,
Expand Down Expand Up @@ -65,7 +65,7 @@ private async Task ShouldCancelPostContentWithNoResponseAndDeserializationWhenCa

TaskCanceledException actualPostContentCanceledTask =
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
await this.restfulApiClient.PostContentWithNoResponseAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PostContentWithNoResponseAsync<TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
cancellationToken: taskCanceledToken,
Expand Down Expand Up @@ -98,7 +98,7 @@ private async Task ShouldPostContentReturnsContentWithCustomSerializationAndDese

// when
TEntity actualTEntity =
await this.restfulApiClient.PostContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PostContentAsync<TEntity>(
relativeUrl: relativeUrl,
content: returnedTEntity,
mediaType: mediaType,
Expand Down Expand Up @@ -135,7 +135,7 @@ private async Task ShouldCancelPostContentWhenCancellationIsInvokedAsync()

TaskCanceledException actualCanceledTaskResult =
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
await this.restfulApiClient.PostContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PostContentAsync<TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
cancellationToken: taskCanceledToken,
Expand Down Expand Up @@ -168,7 +168,7 @@ private async Task ShouldPostContentWithStreamResponseAsync()

// when
Stream actualContent =
await this.restfulApiClient.PostContentWithStreamResponseAsync(
await this.restfulWebAssemblyApiClient.PostContentWithStreamResponseAsync(
relativeUrl: relativeUrl,
content: randomContent,
cancellationToken: cancellationToken,
Expand Down Expand Up @@ -204,7 +204,7 @@ private async Task ShouldPostContentWithTContentReturnsTResultAsync()

// when
TEntity actualTEntity =
await this.restfulApiClient.PostContentAsync<TEntity, TEntity>(
await this.restfulWebAssemblyApiClient.PostContentAsync<TEntity, TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
mediaType: mediaType,
Expand Down Expand Up @@ -239,7 +239,7 @@ private async Task ShouldPostContentWithTContentReturnsTResultCancellationTokenA

// when
TEntity actualTEntity =
await this.restfulApiClient.PostContentAsync<TEntity, TEntity>(
await this.restfulWebAssemblyApiClient.PostContentAsync<TEntity, TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
cancellationToken: cancellationToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private async Task ShouldPutContentReturnsExpectedWithSerializedAndDeserializedC

// when
TEntity actualTEntity =
await this.restfulApiClient.PutContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
mediaType: mediaType,
Expand Down Expand Up @@ -65,7 +65,7 @@ private async Task ShouldCancelTaskOnPutContentReturnsContentIfCancellationInvok
// when
TaskCanceledException actualCanceledTask =
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
await this.restfulApiClient.PutContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
cancellationToken: taskCancelInvoked,
Expand Down Expand Up @@ -100,7 +100,7 @@ private async Task ShouldPutContentWithTContentReturnsTResultAsync()

// when
TEntity actualTEntity =
await this.restfulApiClient.PutContentAsync<TEntity, TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity, TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
mediaType: mediaType,
Expand Down Expand Up @@ -137,7 +137,7 @@ private async Task ShouldPutContentWithTContentReturnsTResultWithCancellationTok

// when
TEntity actualTEntity =
await this.restfulApiClient.PutContentAsync<TEntity, TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity, TEntity>(
relativeUrl: relativeUrl,
content: randomTEntity,
cancellationToken: cancellationToken,
Expand Down Expand Up @@ -169,7 +169,7 @@ private async Task ShouldPutContentReturnsContentWithDeserializationAsync()

// when
TEntity actualTEntity =
await this.restfulApiClient.PutContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity>(
relativeUrl: relativeUrl,
deserializationFunction: DeserializationContentFunction);

Expand Down Expand Up @@ -197,7 +197,7 @@ private async Task ShouldPutContentReturnsContentWithCancellationTokenDeserializ

// when
TEntity actualTEntity =
await this.restfulApiClient.PutContentAsync<TEntity>(
await this.restfulWebAssemblyApiClient.PutContentAsync<TEntity>(
relativeUrl: relativeUrl,
cancellationToken: cancellationToken,
deserializationFunction: DeserializationContentFunction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public partial class RestfulSenseWebAssemblyApiClient
{
private readonly WireMockServer wiremockServer;
private const string relativeUrl = "/tests";
private readonly RESTFulApiClient restfulApiClient;
private readonly RESTFulApiClient restfulWebAssemblyApiClient;

public RestfulSenseWebAssemblyApiClient()
{
this.wiremockServer = WireMockServer.Start();
this.restfulApiClient = new RESTFulApiClient();
this.restfulWebAssemblyApiClient = new RESTFulApiClient();

this.restfulApiClient.BaseAddress = new Uri(
this.restfulWebAssemblyApiClient.BaseAddress = new Uri(
this.wiremockServer.Urls[0]);
}

Expand Down

0 comments on commit b22d189

Please sign in to comment.