public void IntegrationTests_PhaxCode_GetCodeUrl()
        {
            var config = new KeyManager();

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

            var code = phaxio.CreatePhaxCode();

            Assert.IsNotEmpty(code.AbsoluteUri);
        }
        public void UnitTests_PhaxCode_CreateWithUrl_NoOption()
        {
            var clientBuilder = new IRestClientBuilder { Op = "createPhaxCodeUrl" };

            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var phaxCodeUrl = phaxio.CreatePhaxCode();

            var expectedPhaxCodeUrl = PocoFixtures.GetTestPhaxCodeUrl();

            Assert.AreEqual(expectedPhaxCodeUrl, phaxCodeUrl, "URLs should be the same.");
        }
Exemple #3
0
        public void UnitTests_PhaxCode_CreateWithUrl_NoOption()
        {
            var clientBuilder = new IRestClientBuilder {
                Op = "createPhaxCodeUrl"
            };

            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var phaxCodeUrl = phaxio.CreatePhaxCode();

            var expectedPhaxCodeUrl = PocoFixtures.GetTestPhaxCodeUrl();

            Assert.AreEqual(expectedPhaxCodeUrl, phaxCodeUrl, "URLs should be the same.");
        }
        public void UnitTests_PhaxCode_CreateWithUrlAndOptions()
        {
            var metadata = "key=value";

            Action<IRestRequest> requestAsserts = req =>
            {
                var parameters = ParametersHelper.ToDictionary(req.Parameters);
                Assert.AreEqual(metadata, parameters["metadata"], "y's should be the same.");
            };

            var clientBuilder = new IRestClientBuilder { Op = "createPhaxCodeUrl", RequestAsserts = requestAsserts };

            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var phaxCodeUrl = phaxio.CreatePhaxCode(metadata);

            var expectedPhaxCodeUrl = PocoFixtures.GetTestPhaxCodeUrl();

            Assert.AreEqual(expectedPhaxCodeUrl, phaxCodeUrl, "URLs should be the same.");
        }
Exemple #5
0
        public void UnitTests_PhaxCode_CreateWithUrlAndOptions()
        {
            var metadata = "key=value";

            Action <IRestRequest> requestAsserts = req =>
            {
                var parameters = ParametersHelper.ToDictionary(req.Parameters);
                Assert.AreEqual(metadata, parameters["metadata"], "y's should be the same.");
            };

            var clientBuilder = new IRestClientBuilder {
                Op = "createPhaxCodeUrl", RequestAsserts = requestAsserts
            };

            var phaxio = new PhaxioClient(IRestClientBuilder.TEST_KEY, IRestClientBuilder.TEST_SECRET, clientBuilder.Build());

            var phaxCodeUrl = phaxio.CreatePhaxCode(metadata);

            var expectedPhaxCodeUrl = PocoFixtures.GetTestPhaxCodeUrl();

            Assert.AreEqual(expectedPhaxCodeUrl, phaxCodeUrl, "URLs should be the same.");
        }