public void GetCredentialsFailurePasswordTest()
        {
            User user = new User("*****@*****.**", "mypassword");

            BvgConnectorMock connector = GetConnector(CredentialsDataProvider.GetCredentialsWrongPasswordResponse());

            user = connector.GetCredentials(user);
        }
        public void DiscoverPaymentMethodsFailTest()
        {
            BvgConnectorMock connector = GetConnector(DiscoverDataProvider.GetDiscoverFailResponse());

            PaymentMethodsBVG response = connector.DiscoverPaymentMethodBVG();

            Assert.AreNotEqual(null, response);

            Assert.AreEqual(0, response.GetPaymentMethodsBVGList().Count);
        }
        public void GetCredentialsEmptyUserTest()
        {
            User user = new User();

            user.SetPassword("mypassword");

            BvgConnectorMock connector = GetConnector(CredentialsDataProvider.GetCredentialsOkResponse());

            user = connector.GetCredentials(user);
        }
        public void GetCredentialsEmptyPasswordTest()
        {
            User user = new User();

            user.SetUser("*****@*****.**");

            BvgConnectorMock connector = GetConnector(CredentialsDataProvider.GetCredentialsOkResponse());

            user = connector.GetCredentials(user);
        }
        public void GetCredentialsOKTest()
        {
            User user = new User("*****@*****.**", "mypassword");

            BvgConnectorMock connector = GetConnector(CredentialsDataProvider.GetCredentialsOkResponse());

            user = connector.GetCredentials(user);

            Assert.AreEqual(true, !String.IsNullOrEmpty(user.GetApiKey()));
            Assert.AreEqual(true, !String.IsNullOrEmpty(user.GetMerchant()));
        }
Пример #6
0
        public void TransactionOKTest()
        {
            BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionOkResponse());

            TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransaction());

            Assert.AreNotEqual(null, response);

            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetPublicRequestKey()));
            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetMerchantID()));
            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetChannel()));
        }
Пример #7
0
        public void NotificationPushFailTransactionTest()
        {
            BvgConnectorMock connector = GetConnector(NotificationPushDataProvider.GetNotificationPushWrongTransaction());

            NotificationPushBVG response = connector.NotificationPush(NotificationPushDataProvider.GetNotificationPushBVG());

            Assert.AreNotEqual(null, response);

            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetStatusCode()));
            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetStatusMessage()));

            Assert.AreEqual("2070", response.GetStatusCode());
        }
Пример #8
0
        public void NotificationPushFailWithoutFieldTest()
        {
            BvgConnectorMock connector = GetConnector(NotificationPushDataProvider.GetNotificationPushWithoutField());

            NotificationPushBVG response = connector.NotificationPush(NotificationPushDataProvider.GetNotificationPushBVG());

            Assert.AreNotEqual(null, response);

            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetStatusCode()));
            Assert.AreEqual(false, String.IsNullOrEmpty(response.GetStatusMessage()));

            Assert.AreEqual("1014", response.GetStatusCode());
        }
Пример #9
0
        private BvgConnectorMock GetConnector(string response)
        {
            var    headers       = new Dictionary <String, String>();
            string authorization = "TODOPAGO ABCDEF1234567890";

            headers.Add("Authorization", authorization);

            BvgClientMock bvgConnector = new BvgClientMock("https://developers.todopago.com.ar/t/1.1/api/", headers);

            bvgConnector.SetRequestResponse(response);
            BvgConnectorMock connector = new BvgConnectorMock(BvgConnector.developerEndpoint, headers, bvgConnector);

            return(connector);
        }
        public void DiscoverPaymentMethodsOKTest()
        {
            BvgConnectorMock connector = GetConnector(DiscoverDataProvider.GetDiscoverOkResponse());

            PaymentMethodsBVG response = connector.DiscoverPaymentMethodBVG();

            Assert.AreNotEqual(null, response);

            Assert.AreNotEqual(null, response.GetPaymentMethodsBVGList());

            Assert.AreEqual(true, response.GetPaymentMethodsBVGList().Count > 0);

            Dictionary <string, Object> paymentCollection = response.GetPaymentMethodsBVGList()[0];

            Assert.AreEqual(true, paymentCollection.Count > 0);

            Assert.AreEqual(true, paymentCollection.ContainsKey("idMedioPago"));
            Assert.AreEqual(true, paymentCollection.ContainsKey("nombre"));
            Assert.AreEqual(true, paymentCollection.ContainsKey("tipoMedioPago"));
            Assert.AreEqual(true, paymentCollection.ContainsKey("idBanco"));
            Assert.AreEqual(true, paymentCollection.ContainsKey("nombreBanco"));
        }
Пример #11
0
        public void TransactionFailValidationTest()
        {
            BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionOkResponse());

            TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransactionWrongField());
        }
Пример #12
0
        public void TransactionFailValidationRequiredTest()
        {
            BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionFailVendedorResponse());

            TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransactionWithoutField());
        }
Пример #13
0
        public void TransactionFailVendedorTest()
        {
            BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionFailVendedorResponse());

            TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransaction());
        }
Пример #14
0
        public void TransactionWithoutFieldTest()
        {
            BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionFailResponse());

            TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransaction());
        }
        public void GetCredentialsUserNullTest()
        {
            BvgConnectorMock connector = GetConnector(CredentialsDataProvider.GetCredentialsOkResponse());

            connector.GetCredentials(null);
        }
Пример #16
0
        public void TransactionFailValidationTest()
        {
            BvgConnectorMock connector = GetConnector(NotificationPushDataProvider.GetNotificationPushOkResponse());

            NotificationPushBVG response = connector.NotificationPush(NotificationPushDataProvider.GetNotificationPushWrongFieldBVG());
        }