示例#1
0
        public void UnitTests_Phaxio_InvalidSecretThrowsException()
        {
            var clientBuilder = new IRestClientBuilder { Op = "accountStatus" };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, "bad_secret", clientBuilder.Build());

            Assert.Throws(typeof(ApplicationException), () => phaxio.GetAccountStatus());
        }
示例#2
0
        public void UnitTests_Phaxio_InvalidKeyThrowsException()
        {
            var clientBuilder = new IRestClientBuilder { Op = "accountStatus" };
            var phaxio = new PhaxioClient("bad_key", IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            Assert.Throws( typeof(ApplicationException), () => phaxio.GetAccountStatus());
        }
        public void IntegrationTests_AccountStatus_Get()
        {
            var config = new KeyManager();

            var phaxio = new PhaxioClient(config["api_key"], config["api_secret"]);

            var account = phaxio.GetAccountStatus();
        }
示例#4
0
        public void UnitTests_Phaxio_InvalidSecretThrowsException()
        {
            var clientBuilder = new IRestClientBuilder {
                Op = "accountStatus"
            };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, "bad_secret", clientBuilder.Build());

            Assert.Throws(typeof(ApplicationException), () => phaxio.GetAccountStatus());
        }
示例#5
0
        public void UnitTests_Phaxio_InvalidKeyThrowsException()
        {
            var clientBuilder = new IRestClientBuilder {
                Op = "accountStatus"
            };
            var phaxio = new PhaxioClient("bad_key", IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            Assert.Throws(typeof(ApplicationException), () => phaxio.GetAccountStatus());
        }
示例#6
0
        public void UnitTests_Phaxio_ValidKeys()
        {
            var clientBuilder = new IRestClientBuilder { Op = "accountStatus" };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var account = phaxio.GetAccountStatus();

            var expectedAccount = PocoFixtures.GetTestAccount();
        }
示例#7
0
        public void UnitTests_Phaxio_ValidKeys()
        {
            var clientBuilder = new IRestClientBuilder {
                Op = "accountStatus"
            };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var account = phaxio.GetAccountStatus();

            var expectedAccount = PocoFixtures.GetTestAccount();
        }
        public void UnitTests_AccountStatus ()
        {
            var clientBuilder = new IRestClientBuilder { Op = "accountStatus" };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var account = phaxio.GetAccountStatus();

            var expectedAccount = PocoFixtures.GetTestAccount();

            Assert.AreEqual(expectedAccount.FaxesSentThisMonth, account.FaxesSentThisMonth, "FaxesSentThisMonth should be the same.");
            Assert.AreEqual(expectedAccount.FaxesSentToday, account.FaxesSentToday, "FaxesSentThisWeek should be the same.");
            Assert.AreEqual(expectedAccount.Balance, account.Balance, "Balance should be the same.");
        }
示例#9
0
        public void UnitTests_AccountStatus()
        {
            var clientBuilder = new IRestClientBuilder {
                Op = "accountStatus"
            };
            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var account = phaxio.GetAccountStatus();

            var expectedAccount = PocoFixtures.GetTestAccount();

            Assert.AreEqual(expectedAccount.FaxesSentThisMonth, account.FaxesSentThisMonth, "FaxesSentThisMonth should be the same.");
            Assert.AreEqual(expectedAccount.FaxesSentToday, account.FaxesSentToday, "FaxesSentThisWeek should be the same.");
            Assert.AreEqual(expectedAccount.Balance, account.Balance, "Balance should be the same.");
        }