Esempio n. 1
0
        public void TestGetReceiveAddress()
        {
            var coinbaseClient = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var response = coinbaseClient.GetReceiveAddress().Result;

            Assert.IsFalse(String.IsNullOrWhiteSpace(response.Address));
        }
Esempio n. 2
0
        public void TestGetBalance()
        {
            var coinbaseClient = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var balance = coinbaseClient.GetBalance().Result;

            Assert.IsFalse(String.IsNullOrWhiteSpace(balance.Currency));
        }
Esempio n. 3
0
        public void GetAddressesAssociatedWithAccount()
        {
            var client = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var accountAddresses = client.GetAccountAddresses().Result;

            Assert.IsNotNull(accountAddresses);
            Assert.IsTrue(accountAddresses.AccountAddresses.Any());
        }
Esempio n. 4
0
        public void TestSellBitcoin()
        {
            var quantity = 0.0m;

            var coinbaseClient = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var response = coinbaseClient.SellBitcoin(quantity).Result;

            Assert.IsTrue(response.Errors.Any());
        }
Esempio n. 5
0
        public void TestPurchaseBitcoin()
        {
            // Intentional to ensure that we are getting a properly formatted
            // response back from the request.
            var quantity = 0.0m;

            var coinbaseClient = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var response = coinbaseClient.PurchaseBitcoin(quantity).Result;

            Assert.IsTrue(response.Errors.Any());
        }
Esempio n. 6
0
        public void TestGenerateReceiveAddress()
        {
            // TODO:  Re-enable for testing.
            // Disabled to avoid creating so many keys
            // because I love testing.
            //return;

            var callbackUrl = "http://www.google.com";
            var coinbaseClient = new CoinbaseClient(Settings.Default.ApiKey, new ApiKeyAuthenticator());
            var response = coinbaseClient.GetNewReceiveAddress(callbackUrl).Result;

            Assert.AreEqual(callbackUrl, response.CallbackUrl);
            Assert.IsFalse(String.IsNullOrWhiteSpace(response.Address));
        }
Esempio n. 7
0
        public void DisposeClientTwice()
        {
            var coinbaseClient = new CoinbaseClient("APIKEY", new ApiKeyAuthenticator());
            coinbaseClient.Dispose();

            try
            {
                coinbaseClient.Dispose();
            }

            catch (ObjectDisposedException)
            {
                return;
            }

            Assert.Fail("Object disposed of multiple times.");
        }
Esempio n. 8
0
 public void DisposeClientOnce()
 {
     var coinbaseClient = new CoinbaseClient("APIKEY", new ApiKeyAuthenticator());
     coinbaseClient.Dispose();
 }
Esempio n. 9
0
 public void CreateClientWithApiKey()
 {
     var coinbaseClient = new CoinbaseClient("APIKEY", new ApiKeyAuthenticator());
 }