public async Task It_returns_result_parsed_from_error_JSON() { // Arrange // Copied from real life error string jsonError = "{\"Result\":\"Failure\",\"Message\":\"Invalid Launch Code\"}"; MockApi.WarheadsLaunchAsync(null) .ThrowsForAnyArgs(new ApiException(500, null, jsonError)); // Act var actual = await SUT.Launch(CorrectPassphrase); // Assert actual.Message.Should().Be("Invalid Launch Code"); }