From 64fb8605a35f1b46274c3223398a8437f8b3a175 Mon Sep 17 00:00:00 2001 From: Sefa Can Date: Sat, 26 Dec 2020 13:45:38 +0300 Subject: [PATCH] remove not yet completed provider tests --- .../FinansbankPaymentProviderTests.cs | 72 ----------- .../KuveytTurkPaymentProviderTests.cs | 120 ------------------ 2 files changed, 192 deletions(-) delete mode 100644 tests/ThreeDPayment.Tests/FinansbankPaymentProviderTests.cs delete mode 100644 tests/ThreeDPayment.Tests/KuveytTurkPaymentProviderTests.cs diff --git a/tests/ThreeDPayment.Tests/FinansbankPaymentProviderTests.cs b/tests/ThreeDPayment.Tests/FinansbankPaymentProviderTests.cs deleted file mode 100644 index 1fa0724..0000000 --- a/tests/ThreeDPayment.Tests/FinansbankPaymentProviderTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Threading.Tasks; -using ThreeDPayment.Providers; -using ThreeDPayment.Requests; -using Xunit; - -namespace ThreeDPayment.Tests -{ - public class FinansbankPaymentProviderTests - { - [Fact] - public void PaymentProviderFactory_CreateAssecoPaymentProvider() - { - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.FinansBank); - - Assert.IsType(provider); - } - - [Fact] - public async Task Finansbank_GetPaymentParameterResult_Success() - { - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.FinansBank); - - var paymentGatewayResult = await provider.ThreeDGatewayRequest(new PaymentGatewayRequest - { - CardHolderName = "Sefa Can", - CardNumber = "4508-0345-0803-4509", - ExpireMonth = 12, - ExpireYear = 21, - CvvCode = "000", - CardType = "1", - Installment = 1, - TotalAmount = 1.60m, - CustomerIpAddress = "127.0.0.1", - CurrencyIsoCode = "949", - LanguageIsoCode = "tr", - OrderNumber = Guid.NewGuid().ToString(), - BankName = BankNames.IsBankasi, - BankParameters = provider.TestParameters, - CallbackUrl = new Uri("https://google.com") - }); - - Assert.True(paymentGatewayResult.Success); - } - - [Fact] - public async Task Finansbank_GetPaymentParameterResult_UnSuccess() - { - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.FinansBank); - var paymentGatewayResult = await provider.ThreeDGatewayRequest(null); - - Assert.False(paymentGatewayResult.Success); - } - } -} \ No newline at end of file diff --git a/tests/ThreeDPayment.Tests/KuveytTurkPaymentProviderTests.cs b/tests/ThreeDPayment.Tests/KuveytTurkPaymentProviderTests.cs deleted file mode 100644 index 4bdb46f..0000000 --- a/tests/ThreeDPayment.Tests/KuveytTurkPaymentProviderTests.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Text; -using System.Threading.Tasks; -using ThreeDPayment.Providers; -using ThreeDPayment.Requests; -using Xunit; - -namespace ThreeDPayment.Tests -{ - public class KuveytTurkPaymentProviderTests - { - [Fact] - public void PaymentProviderFactory_CreateKuveytTurkPaymentProvider() - { - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.KuveytTurk); - - Assert.IsType(provider); - } - - [Fact] - public async Task KuveytTurk_GetPaymentParameterResult_Success() - { - //it must be here for different encoding options, KuveytTurk uses different encoding type that doesn't come in default encoding collection - Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); - - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.KuveytTurk); - var paymentGatewayResult = await provider.ThreeDGatewayRequest(new PaymentGatewayRequest - { - CardHolderName = "Sefa Can", - CardNumber = "4033602562020327", - ExpireMonth = 1, - ExpireYear = 30, - CvvCode = "861", - CardType = "Troy", - Installment = 1, - TotalAmount = 1.60m, - CustomerIpAddress = "127.0.0.1", - CurrencyIsoCode = "949", - LanguageIsoCode = "tr", - OrderNumber = Guid.NewGuid().ToString(), - BankName = BankNames.KuveytTurk, - BankParameters = provider.TestParameters, - CallbackUrl = new Uri("https://google.com") - }); - - Assert.NotEmpty(paymentGatewayResult.HtmlFormContent); - Assert.True(paymentGatewayResult.HtmlContent); - Assert.True(paymentGatewayResult.Success); - } - - /* - * - - - - - - -
- - - - - -
- - - - - */ - - [Fact] - public async Task KuveytTurk_GetPaymentParameterResult_UnSuccess() - { - ServiceCollection serviceCollection = new ServiceCollection(); - serviceCollection.AddHttpClient(); - - ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); - PaymentProviderFactory paymentProviderFactory = new PaymentProviderFactory(serviceProvider); - - IPaymentProvider provider = paymentProviderFactory.Create(BankNames.KuveytTurk); - var paymentGatewayResult = await provider.ThreeDGatewayRequest(null); - - Assert.False(paymentGatewayResult.Success); - } - } -}