public async Task PutAsync_Ok() { var testDomain = TestData.TestDomains.First(); var test = TestTransferData.TestTransfers.First(); var resultTest = new ResultValue <TestTransfer>(test); var restClient = RestClientMock.PutRestClient(resultTest); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.PutAsync(testDomain); Assert.True(result.OkStatus); }
public async Task PutAsync_Error() { var testDomain = TestData.TestDomains.First(); var error = ErrorTransferData.ErrorBadRequest; var resultTest = new ResultError(error); var restClient = RestClientMock.PutRestClient(resultTest); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.PutAsync(testDomain); Assert.True(result.HasErrors); Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.BadRequest); }