-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- For tests using the https://apitest.authorize.net/xml/v1/request.api, the paypal and applypay tests fail. These failures are known. - For tests using the https://test.authorize.net/gateway/transact.dll, there are 4 test failures. These failures need to be looked into more closely.
- Loading branch information
1 parent
b2be014
commit 76721ba
Showing
7 changed files
with
2,259 additions
and
2,259 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"> | ||
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> | ||
<RunConfiguration id="b519da70-f2b9-42e9-8322-f70b4aedb1c0" name="Local Test Run" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
</TestList> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> | ||
<RunConfiguration id="b519da70-f2b9-42e9-8322-f70b4aedb1c0" name="Local Test Run" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
</TestList> | ||
</TestLists> |
169 changes: 85 additions & 84 deletions
169
AuthorizeNETtest/Api/Controllers/Test/APIInvalidCredentials.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,85 @@ | ||
namespace AuthorizeNet.Api.Controllers.Test | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using AuthorizeNet.Api.Contracts.V1; | ||
using AuthorizeNet.Api.Controllers; | ||
using AuthorizeNet.Api.Controllers.Bases; | ||
using AuthorizeNet.Util; | ||
|
||
[TestFixture] | ||
public class CredentialsTest : ApiCoreTestBase | ||
{ | ||
|
||
[TestFixtureSetUp] | ||
public new static void SetUpBeforeClass() | ||
{ | ||
ApiCoreTestBase.SetUpBeforeClass(); | ||
} | ||
|
||
[TestFixtureTearDown] | ||
public new static void TearDownAfterClass() | ||
{ | ||
ApiCoreTestBase.TearDownAfterClass(); | ||
} | ||
|
||
[SetUp] | ||
public new void SetUp() | ||
{ | ||
base.SetUp(); | ||
} | ||
|
||
[TearDown] | ||
public new void TearDown() | ||
{ | ||
base.TearDown(); | ||
} | ||
|
||
[Test] | ||
public void InvalidCredentialsTest() | ||
{ | ||
LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest"); | ||
merchantAuthenticationType badCredentials = new merchantAuthenticationType { name = "mbld_api_-NPA5n9k", Item = "123123", ItemElementName = ItemChoiceType.transactionKey }; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = badCredentials; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment; | ||
|
||
//create request | ||
getCustomerProfileRequest getCPReq = new getCustomerProfileRequest() | ||
{ | ||
customerProfileId = "1234" | ||
}; | ||
|
||
getCustomerProfileController getCPCont = new getCustomerProfileController(getCPReq); | ||
getCPCont.Execute(); | ||
getCustomerProfileResponse getCPResp = getCPCont.GetApiResponse(); | ||
|
||
Assert.AreEqual("E00007", ((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCPResp)).messages.message[0].code); | ||
ValidateErrorCode(((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCPResp)).messages, "E00007"); | ||
} | ||
|
||
[Test] | ||
public void IllFormedCredentialsTest() | ||
{ | ||
LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest"); | ||
merchantAuthenticationType badCredentials = new merchantAuthenticationType { name = "mbld_api_-NPA5n9k", Item = "123123" }; //, ItemElementName = ItemChoiceType.transactionKey }; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = badCredentials; | ||
|
||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment; | ||
|
||
//create request | ||
getCustomerProfileRequest getCPReq = new getCustomerProfileRequest() | ||
{ | ||
customerProfileId = "1234" | ||
}; | ||
|
||
getCustomerProfileController getCPCont = new getCustomerProfileController(getCPReq); | ||
getCPCont.Execute(); | ||
getCustomerProfileResponse getCPResp = getCPCont.GetApiResponse(); | ||
|
||
Assert.AreEqual("E00007", ((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCPResp)).messages.message[0].code); | ||
ValidateErrorCode(getCPResp.messages, "E00007"); | ||
} | ||
} | ||
} | ||
namespace AuthorizeNet.Api.Controllers.Test | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using AuthorizeNet.Api.Contracts.V1; | ||
using AuthorizeNet.Api.Controllers; | ||
using AuthorizeNet.Api.Controllers.Bases; | ||
using AuthorizeNet.Util; | ||
|
||
[TestFixture] | ||
public class CredentialsTest : ApiCoreTestBase | ||
{ | ||
|
||
[TestFixtureSetUp] | ||
public new static void SetUpBeforeClass() | ||
{ | ||
ApiCoreTestBase.SetUpBeforeClass(); | ||
} | ||
|
||
[TestFixtureTearDown] | ||
public new static void TearDownAfterClass() | ||
{ | ||
ApiCoreTestBase.TearDownAfterClass(); | ||
} | ||
|
||
[SetUp] | ||
public new void SetUp() | ||
{ | ||
base.SetUp(); | ||
} | ||
|
||
[TearDown] | ||
public new void TearDown() | ||
{ | ||
base.TearDown(); | ||
} | ||
|
||
[Test] | ||
public void InvalidCredentialsTest() | ||
{ | ||
LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest"); | ||
|
||
var badCredentials = new merchantAuthenticationType { name = "mbld_api_-NPA5n9k", Item = "123123", ItemElementName = ItemChoiceType.transactionKey }; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = badCredentials; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment; | ||
|
||
//create request | ||
var getCpReq = new getCustomerProfileRequest | ||
{ | ||
customerProfileId = "1234" | ||
}; | ||
|
||
var getCpCont = new getCustomerProfileController(getCpReq); | ||
getCpCont.Execute(); | ||
getCustomerProfileResponse getCpResp = getCpCont.GetApiResponse(); | ||
|
||
Assert.AreEqual("E00007", ((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCpResp)).messages.message[0].code); | ||
ValidateErrorCode(((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCpResp)).messages, "E00007"); | ||
} | ||
|
||
[Test] | ||
public void IllFormedCredentialsTest() | ||
{ | ||
LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest"); | ||
|
||
var badCredentials = new merchantAuthenticationType { name = "mbld_api_-NPA5n9k", Item = "123123" }; //, ItemElementName = ItemChoiceType.transactionKey }; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = badCredentials; | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment; | ||
|
||
//create request | ||
var getCpReq = new getCustomerProfileRequest | ||
{ | ||
customerProfileId = "1234" | ||
}; | ||
|
||
var getCpCont = new getCustomerProfileController(getCpReq); | ||
getCpCont.Execute(); | ||
var getCpResp = getCpCont.GetApiResponse(); | ||
|
||
Assert.AreEqual("E00007", ((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCpResp)).messages.message[0].code); | ||
ValidateErrorCode(getCpResp.messages, "E00007"); | ||
} | ||
} | ||
} |
Oops, something went wrong.