public static KrakenClient CreateWorkingClient(bool debug = false) { var connection = KrakenConnection.Create(Settings.ApiKey, Settings.ApiSecret, debug); var krakenClient = new KrakenClient(connection); return(krakenClient); }
public void ConnectionCreate_NullSecretError_IsTrue() { try { KrakenConnection.Create("key", null); Assert.IsTrue(false); } catch (Exception) { Assert.IsTrue(true, "Exception"); } }
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); }
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"); } }
public void ConnectionCreate_Dispose_IsTrue() { var krakenConnection = KrakenConnection.Create("key", "secret"); try { krakenConnection.Dispose(); Assert.IsTrue(true); } catch (Exception) { Assert.IsTrue(false, "Exception"); } }
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); } }
public void KrakenClient_IsSandboxMode_IsTrue() { var connection = KrakenConnection.Create("key", "secret", true); Assert.IsTrue(connection.SandboxMode); }
public void KrakenClient_NotInSandboxModeExpl_IsTrue() { var connection = KrakenConnection.Create("key", "secret", false); Assert.IsTrue(connection.SandboxMode == false); }