public async Task PostValueAsync_Error() { var test = TestData.TestDomains.First(); var error = ErrorTransferData.ErrorBadRequest; var resultIds = new ResultValue <TestEnum>(error); var restClient = RestClientMock.PostRestClient(resultIds); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.PostValueAsync(test); Assert.True(result.HasErrors); Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.BadRequest); }
public async Task PostValueAsync_Ok() { var test = TestData.TestDomains.First(); var testId = test.Id; var resultId = new ResultValue <TestEnum>(testId); var restClient = RestClientMock.PostRestClient(resultId); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.PostValueAsync(test); Assert.True(result.OkStatus); Assert.True(result.Value.Equals(testId)); }