public void TestInvalidBuyParameters() { try { CoinbaseClient.GetBitcoinBuyPrice(-1).Wait(); Assert.Fail("Should not be able to pass negative bitcoin quantity"); } catch (Exception exception) { if (exception is ArgumentOutOfRangeException) { return; } var aggregateException = exception as AggregateException; if (aggregateException != null) { if (aggregateException.InnerExceptions != null) { if (aggregateException.InnerExceptions.All(e => e is ArgumentOutOfRangeException)) { return; } } } throw; } }
public void TestGetBuyPrice() { var prices = CoinbaseClient.GetBitcoinBuyPrice().Result; // Assert that currencies are returned from service. // We can't go on price values since fees can be waived, negated, etc. Assert.IsTrue(prices.Fees.Any()); Assert.IsFalse(String.IsNullOrWhiteSpace(prices.Subtotal.Currency)); Assert.IsFalse(String.IsNullOrWhiteSpace(prices.TotalAmount.Currency)); }