public async Task Test_GetRateAsync_Success() { var payByte = new PayByte(isTestNet: true); var rate = await payByte.GetRateAsync("GBP"); Assert.AreEqual(rate["rate"]["name"].Value <string>(), "GBP", "the currency code should be GBP."); Assert.AreEqual(rate["error"].Value <string>(), "ok", "the get reate should have been successfull."); }
public async Task Test_CreatePaymentAsync_Success() { var payByte = new PayByte(isTestNet: true); var payment = new Payment { Amount = (decimal)0.0332, ApiKey = merchantApiKey, Coin = "BTC" }; var resp = await payByte.CreatePaymentAsync(payment); Assert.AreEqual(resp["transaction"]["amount"].Value <decimal>(), payment.Amount, "the amount should match."); Assert.AreEqual(resp["transaction"]["status"].Value <string>(), "pending", "the status should be pending."); Assert.IsTrue(!string.IsNullOrWhiteSpace(resp["transaction"]["payment-address"].Value <string>()), "the payment address should not be empty."); Assert.AreEqual(resp["error"].Value <string>(), "ok", "the payment should have been correctly created."); }