public async Task FetchReceipt_400_ReturnsNull() { // Arrange _httpTest.RespondWith(status: 400); _smartContractService = new SmartContractService(_nodeOptions.Object, _logger.Object); // Act var result = await _smartContractService.FetchReceiptAsync <int>("hx78s8dj3uuiwejfuew98f8wef8"); // Assert Assert.That(result, Is.Null); }
public async Task FetchReceipt_200_ReturnsResponse() { // Arrange var receipt = new Receipt <int, object> { ReturnValue = 5 }; _httpTest.RespondWithJson(receipt, status: 200); _smartContractService = new SmartContractService(_nodeOptions.Object, _logger.Object); // Act var result = await _smartContractService.FetchReceiptAsync <int>("hx78s8dj3uuiwejfuew98f8wef8"); // Assert var expected = JsonConvert.SerializeObject(receipt); var actual = JsonConvert.SerializeObject(result); Assert.That(actual, Is.EqualTo(expected)); }