private void AddressUxoutsLive() { var apiInstance = new DefaultApi(nodeAddress); var testCases = new[] { new { name = "no addresses", errCode = 400, errMsg = "Error calling AddressUxouts: 400 Bad Request - address is empty\n", address = "" }, new { name = "invalid address length", errCode = 400, errMsg = "Error calling AddressUxouts: 400 Bad Request - Invalid address length\n", address = "prRXwTcDK24hs6AFxj" }, new { name = "unknown address", errCode = 200, errMsg = "", address = "prRXwTcDK24hs6AFxj69UuWae3LzhrsPW9" }, new { name = "one address", errCode = 200, errMsg = "", address = "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf" } }; foreach (var tc in testCases) { if (tc.errCode != 0 && tc.errCode != 200) { var err = Assert.Throws <ApiException>(() => apiInstance.AddressUxouts(tc.address)); Assert.Equal(err.ErrorCode, tc.errCode); Assert.Equal(err.Message, tc.errMsg); } else { var result = apiInstance.AddressUxouts(tc.address); Assert.Empty(result); } } }
private void AddressUxoutsStable() { var apiInstance = new DefaultApi(nodeAddress); var testCases = new[] { new { name = "no addresses", errCode = 400, errMsg = "Error calling AddressUxouts: 400 Bad Request - address is empty\n", golden = "", address = "" }, new { name = "unknown address", errCode = 200, errMsg = "", golden = "uxout-noaddr.golden", address = "prRXwTcDK24hs6AFxj69UuWae3LzhrsPW9" }, new { name = "one address", errCode = 200, errMsg = "", golden = "uxout-addr.golden", address = "2THDupTBEo7UqB6dsVizkYUvkKq82Qn4gjf" } }; foreach (var tc in testCases) { if (tc.errCode != 200 && tc.errCode != 0) { var err = Assert.Throws <ApiException>(() => apiInstance.AddressUxouts(tc.address)); Assert.Equal(err.ErrorCode, tc.errCode); Assert.Equal(err.Message, tc.errMsg); } else { var result = apiInstance.AddressUxouts(tc.address); CheckGoldenFile(tc.golden, JsonConvert.SerializeObject(result, Formatting.Indented)); } } }