Example #1
0
        public static KrakenClient CreateWorkingClient(bool debug = false)
        {
            var connection   = KrakenConnection.Create(Settings.ApiKey, Settings.ApiSecret, debug);
            var krakenClient = new KrakenClient(connection);

            return(krakenClient);
        }
Example #2
0
 public void ConnectionCreate_NullSecretError_IsTrue()
 {
     try
     {
         KrakenConnection.Create("key", null);
         Assert.IsTrue(false);
     }
     catch (Exception)
     {
         Assert.IsTrue(true, "Exception");
     }
 }
Example #3
0
 public void ConnectionCreate_NullKeyError_IsTrue()
 {
     try
     {
         KrakenConnection.Create(null, "secret");
         Assert.IsTrue(false);
     }
     catch (Exception)
     {
         Assert.IsTrue(true, "Exception");
     }
 }
        public void KrakenClient_UnauthorizedSandbox_IsTrue()
        {
            var connection   = KrakenConnection.Create("key", "secret");
            var krakenClient = new KrakenClient(connection);

            var response = krakenClient.OptimizeWait(
                new Uri(TestData.ImageOne));

            var result = response.Result;

            Assert.IsTrue(result.StatusCode == HttpStatusCode.Unauthorized);
        }
Example #5
0
        public void KrakenClient_NoErrors_IsTrue()
        {
            try
            {
                var connection   = KrakenConnection.Create("key", "secret");
                var krakenClient = new KrakenClient(connection);

                Assert.IsTrue(true);
            }
            catch (Exception)
            {
                Assert.IsTrue(false, "Exception");
            }
        }
Example #6
0
        public void ConnectionCreate_Dispose_IsTrue()
        {
            var krakenConnection = KrakenConnection.Create("key", "secret");

            try
            {
                krakenConnection.Dispose();

                Assert.IsTrue(true);
            }
            catch (Exception)
            {
                Assert.IsTrue(false, "Exception");
            }
        }
Example #7
0
        public void KrakenClient_RequestUploadCallbackNoFileNameError_IsTrue()
        {
            var krakenConnection = KrakenConnection.Create("key", "secret");
            var krakenClient     = new KrakenClient(krakenConnection);

            try
            {
                krakenClient.Optimize(
                    null,
                    string.Empty,
                    new OptimizeUploadRequest()
                    );

                Assert.IsTrue(false, "No exception");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }
Example #8
0
        public void KrakenClient_IsSandboxMode_IsTrue()
        {
            var connection = KrakenConnection.Create("key", "secret", true);

            Assert.IsTrue(connection.SandboxMode);
        }
Example #9
0
        public void KrakenClient_NotInSandboxModeExpl_IsTrue()
        {
            var connection = KrakenConnection.Create("key", "secret", false);

            Assert.IsTrue(connection.SandboxMode == false);
        }