Example #1
0
        public void BuildUrlIsSandboxTest()
        {
            IOptions options = new ButtonOptions();

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.SandboxButtonUrl));
        }
Example #2
0
        public void BuildUrlTest()
        {
            VisaHelper.Environment.IsSandbox = false;
            IOptions options = new ButtonOptions();

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.ProductionButtonUrl));
        }
Example #3
0
        public void BuildUrlWithOptionsTest()
        {
            VisaHelper.Environment.IsSandbox = false;
            IOptions options = new ButtonOptions
            {
                CardBrands = SupportedCards.AMEX | SupportedCards.VISA,
                Color      = ButtonColors.Neutral,
                Size       = ButtonSizes.Large
            };

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.ProductionButtonUrl));
            Assert.IsTrue(result.Contains("cardBrands=VISA,AMEX"));
            Assert.IsTrue(result.Contains("color=neutral"));
            Assert.IsTrue(result.Contains("size=425"));
        }