public void Then_The_Post_Url_Is_Correctly_Built(RecalculateEarningsRequest data) { var actual = new PostRecalculateEarningsRequest(data); actual.PostUrl.Should().Be($"earningsRecalculations"); actual.Data.Should().BeEquivalentTo(data); }
public async Task RecalculateEarnings(RecalculateEarningsRequest recalculateEarningsRequest) { var postRequest = new PostRecalculateEarningsRequest(recalculateEarningsRequest); var response = await _client.PostWithResponseCode <PostRecalculateEarningsRequest>(postRequest); if (ApiResponseErrorChecking.IsSuccessStatusCode(response.StatusCode)) { return; } throw new HttpRequestContentException($"Response status code does not indicate success: {(int)response.StatusCode} ({response.StatusCode})", response.StatusCode, response.ErrorContent); }