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())); }
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())); }
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()); }
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()); }
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")); }
public void TransactionFailValidationTest() { BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionOkResponse()); TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransactionWrongField()); }
public void TransactionFailValidationRequiredTest() { BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionFailVendedorResponse()); TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransactionWithoutField()); }
public void TransactionFailVendedorTest() { BvgConnectorMock connector = GetConnector(TransactionDataProvider.GetTransactionFailVendedorResponse()); TransactionBVG response = connector.Transaction(TransactionDataProvider.GetTransaction()); }
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); }
public void TransactionFailValidationTest() { BvgConnectorMock connector = GetConnector(NotificationPushDataProvider.GetNotificationPushOkResponse()); NotificationPushBVG response = connector.NotificationPush(NotificationPushDataProvider.GetNotificationPushWrongFieldBVG()); }