Skip to content

Commit f3b921b

Browse files
committed
Continue fixing failures. Now 3 failures out of 131 tests.
1 parent e01ad23 commit f3b921b

File tree

5 files changed

+97
-84
lines changed

5 files changed

+97
-84
lines changed

AuthorizeNET.sln

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,50 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNET", "Authorize.NET\AuthorizeNET.csproj", "{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}"
5-
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNETtest", "AuthorizeNETtest\AuthorizeNETtest.csproj", "{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}"
7-
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoffeeShopWebApp", "CoffeeShopWebApp\CoffeeShopWebApp.csproj", "{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}"
9-
ProjectSection(ProjectDependencies) = postProject
10-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14} = {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}
11-
EndProjectSection
12-
EndProject
13-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7EBF48A1-8AC1-4E84-BDCC-E0984183D098}"
14-
ProjectSection(SolutionItems) = preProject
15-
AuthorizeNET.vsmdi = AuthorizeNET.vsmdi
16-
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
17-
EndProjectSection
18-
EndProject
19-
Global
20-
GlobalSection(TestCaseManagementSettings) = postSolution
21-
CategoryFile = AuthorizeNET.vsmdi
22-
EndGlobalSection
23-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24-
Debug|Any CPU = Debug|Any CPU
25-
Release|Any CPU = Release|Any CPU
26-
USELOCAL|Any CPU = USELOCAL|Any CPU
27-
EndGlobalSection
28-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
34-
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
35-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.ActiveCfg = Release|Any CPU
38-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
40-
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
41-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
46-
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
47-
EndGlobalSection
48-
GlobalSection(SolutionProperties) = preSolution
49-
HideSolutionNode = FALSE
50-
EndGlobalSection
51-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNET", "Authorize.NET\AuthorizeNET.csproj", "{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizeNETtest", "AuthorizeNETtest\AuthorizeNETtest.csproj", "{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoffeeShopWebApp", "CoffeeShopWebApp\CoffeeShopWebApp.csproj", "{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}"
9+
ProjectSection(ProjectDependencies) = postProject
10+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14} = {5D52EAEC-42FB-4313-83B8-69E2F55EBF14}
11+
EndProjectSection
12+
EndProject
13+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7EBF48A1-8AC1-4E84-BDCC-E0984183D098}"
14+
ProjectSection(SolutionItems) = preProject
15+
AuthorizeNET.vsmdi = AuthorizeNET.vsmdi
16+
EndProjectSection
17+
EndProject
18+
Global
19+
GlobalSection(TestCaseManagementSettings) = postSolution
20+
CategoryFile = AuthorizeNET.vsmdi
21+
EndGlobalSection
22+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
23+
Debug|Any CPU = Debug|Any CPU
24+
Release|Any CPU = Release|Any CPU
25+
USELOCAL|Any CPU = USELOCAL|Any CPU
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
33+
{5D52EAEC-42FB-4313-83B8-69E2F55EBF14}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
34+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
39+
{CDA0D4D8-E4AA-4BEA-8839-04D69607D914}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
40+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.ActiveCfg = USELOCAL|Any CPU
45+
{79796297-BA7B-4F22-8C53-D9B6EFDD7EB7}.USELOCAL|Any CPU.Build.0 = USELOCAL|Any CPU
46+
EndGlobalSection
47+
GlobalSection(SolutionProperties) = preSolution
48+
HideSolutionNode = FALSE
49+
EndGlobalSection
50+
EndGlobal

AuthorizeNETtest/Api/Controllers/Test/APIInvalidCredentials.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ public void IllFormedCredentialsTest()
7474
customerProfileId = "1234"
7575
};
7676

77-
var getCpCont = new getCustomerProfileController(getCpReq);
78-
getCpCont.Execute();
79-
var getCpResp = getCpCont.GetApiResponse();
80-
81-
Assert.AreEqual("E00007", ((AuthorizeNet.Api.Contracts.V1.ANetApiResponse)(getCpResp)).messages.message[0].code);
82-
ValidateErrorCode(getCpResp.messages, "E00007");
77+
try
78+
{
79+
var getCpCont = new getCustomerProfileController(getCpReq);
80+
getCpCont.Execute();
81+
Assert.Fail("You should not reach here");
82+
}
83+
catch (Exception e)
84+
{
85+
Console.WriteLine("An exception expected: " + e.Message);
86+
}
8387
}
8488
}
8589
}

AuthorizeNETtest/GatewayECheckTest.cs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,24 +237,29 @@ public void SendTest_PriorAuthCapture_Approved()
237237
/// Credit Transaction - Approved
238238
/// </summary>
239239
[Test()]
240+
[Ignore("To run this test, find a settled ECheck transaction and configure this test below.")]
240241
public void SendTest_Credit_Approved()
241242
{
243+
// Test setup.
244+
const string transId = "????"; // A settled eCheck transaction id
245+
const decimal creditAmount = (decimal) 1.50; // Amount to request credit for; less than the settled amount minus refund amount.
246+
const string accountType = "eCheck"; // The account type used in the transaction, such as eCheck
247+
const string accountLast4Digits = "????"; // The last 4 digitals of the account number used in the transaction, such as 3456
248+
242249
//check login / password
243-
string sError = CheckLoginPassword();
250+
var sError = CheckLoginPassword();
244251
Assert.IsTrue(sError == "", sError);
245252

246-
string transID = "2207700297";
247-
248-
string responseString = "1|1|1|This transaction has been approved.||P|2207741772||Credit transaction approved testing|5.14|CC|credit||||||||||||[email protected]||||||||||||||574B2D5282D8A2914AEB7272AECD4B71|||||||||||||XXXX1111|Visa||||||||||||||||";
253+
var responseString = "1|1|1|This transaction has been approved.||P|2207741772||Credit transaction approved testing|"+creditAmount+"|CC|credit||||||||||||[email protected]||||||||||||||574B2D5282D8A2914AEB7272AECD4B71|||||||||||||XXXX"+accountLast4Digits+"|"+accountType+"||||||||||||||||";
249254
LocalRequestObject.ResponseString = responseString;
250255
IGatewayResponse expected = new GatewayResponse(responseString.Split('|'));
251256

252-
Gateway target = new Gateway(ApiLogin, TransactionKey, true);
257+
var target = new Gateway(ApiLogin, TransactionKey, true);
253258

254-
IGatewayRequest request = new EcheckCreditRequest(transID, (decimal)5.14, "3456");
255-
string description = "Credit transaction approved testing";
259+
IGatewayRequest request = new EcheckCreditRequest(transId, creditAmount, accountLast4Digits);
260+
const string description = "Credit transaction approved testing";
256261

257-
IGatewayResponse actual = target.Send(request, description);
262+
var actual = target.Send(request, description);
258263

259264
Assert.AreEqual(expected.Amount, actual.Amount);
260265
Assert.AreEqual(expected.Approved, actual.Approved);
@@ -263,7 +268,7 @@ public void SendTest_Credit_Approved()
263268
Assert.AreEqual(expected.ResponseCode, actual.ResponseCode);
264269

265270
Assert.IsTrue(actual.TransactionID.Trim().Length > 0);
266-
Assert.IsTrue(long.Parse(actual.TransactionID) > 0);
271+
Assert.Greater(long.Parse(actual.TransactionID), 0);
267272
}
268273

269274
/// <summary>
@@ -276,15 +281,15 @@ public void SendTest_UnlinkedCredit_Approved()
276281
string sError = CheckLoginPassword();
277282
Assert.IsTrue(sError == "", sError);
278283

279-
string responseString = "4|1|193|The transaction is currently under review.||P|2207750459||UnlinkedCredit transaction approved testing|15.15|ECHECK|||||||||||||||||||||||||||028371CBD0646BDA25EC4206BF2FC7A5|||||||||||||XXXX3456|Bank Account||||||||||||||||";
284+
const string responseString = "4|1|193|The transaction is currently under review.||P|2207750459||UnlinkedCredit transaction approved testing|15.15|ECHECK|||||||||||||||||||||||||||028371CBD0646BDA25EC4206BF2FC7A5|||||||||||||XXXX3456|Bank Account||||||||||||||||";
280285
LocalRequestObject.ResponseString = responseString;
281286
IGatewayResponse expected = new GatewayResponse(responseString.Split('|'));
282287

283-
Gateway target = new Gateway(ApiLogin, TransactionKey, true);
288+
var target = new Gateway(ApiLogin, TransactionKey, true);
284289

285290
IGatewayRequest request = new EcheckUnlinkedCreditRequest(EcheckType.WEB, (decimal)15.15, "125000024", "123456", BankAccountType.Checking, "Bank of Seattle", "Sue Zhu", "1234");
286291
request.DuplicateWindow = "0";
287-
string description = "UnlinkedCredit transaction approved testing";
292+
const string description = "UnlinkedCredit transaction approved testing";
288293

289294
IGatewayResponse actual = target.Send(request, description);
290295

AuthorizeNETtest/GatewayTest.cs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void SendTest_AuthCap_Approved()
2020
string sError = CheckLoginPassword();
2121
Assert.IsTrue(sError == "", sError);
2222

23-
string responseString = "1|1|1|This transaction has been approved.|7339F5|Y|2207176015||testing|20.10|CC|auth_capture||||||||||||||||||||||||||7639D026F54F4DF70EA3F7DE5A350929||2|||||||||||XXXX1111|Visa||||||||||||||||";
23+
string responseString = "1|1|1|This transaction has been approved.|7339F5|Y|2207176015||testing|20.10|CC|auth_capture||||||||||||||||||||||||||7639D026F54F4DF70EA3F7DE5A350929||2|||||||||||XXXX0015|Visa||||||||||||||||";
2424
LocalRequestObject.ResponseString = responseString;
2525
IGatewayResponse expected = new GatewayResponse(responseString.Split('|'));
2626

@@ -156,22 +156,27 @@ public void SendTest_PriorAuthCapture_Approved()
156156
/// Credit Transaction - Approved
157157
/// </summary>
158158
[Test()]
159+
[Ignore("To run this test, find a settled credit-card transaction and configure this test below.")]
159160
public void SendTest_Credit_Approved()
160161
{
162+
// Test setup.
163+
const string transId = "????"; // A settled transaction id
164+
const decimal creditAmount = (decimal) 1.50; // Amount to request credit for; less than the settled amount minus refunded amounts.
165+
const string accountType = "????"; // The account type used in the transaction, such as Visa
166+
const string accountLast4Digits = "????"; // The last 4 digitals of the account number used in the transaction, such as 1111
167+
161168
//check login / password
162169
string sError = CheckLoginPassword();
163-
Assert.IsTrue(sError == "", sError);
164-
165-
string transID = "2207700297";
166-
167-
string responseString = "1|1|1|This transaction has been approved.||P|2207741772||Credit transaction approved testing|6.14|CC|credit||||||||||||[email protected]||||||||||||||574B2D5282D8A2914AEB7272AECD4B71|||||||||||||XXXX1111|Visa||||||||||||||||";
170+
Assert.IsTrue(sError == "", sError);
171+
172+
var responseString = "1|1|1|This transaction has been approved.||P|2207741772||Credit transaction approved testing|"+creditAmount+"|CC|credit||||||||||||[email protected]||||||||||||||574B2D5282D8A2914AEB7272AECD4B71|||||||||||||XXXX"+accountLast4Digits+"|"+accountType+"||||||||||||||||";
168173
LocalRequestObject.ResponseString = responseString;
169174
IGatewayResponse expected = new GatewayResponse(responseString.Split('|'));
170175

171-
Gateway target = new Gateway(ApiLogin, TransactionKey, true);
172-
173-
IGatewayRequest request = new CreditRequest(transID, (decimal)6.14, "1111");
174-
string description = "Credit transaction approved testing";
176+
var target = new Gateway(ApiLogin, TransactionKey, true);
177+
178+
IGatewayRequest request = new CreditRequest(transId, creditAmount, accountLast4Digits);
179+
const string description = "Credit transaction approved testing";
175180

176181
IGatewayResponse actual = target.Send(request, description);
177182

@@ -182,7 +187,7 @@ public void SendTest_Credit_Approved()
182187
Assert.AreEqual(expected.ResponseCode, actual.ResponseCode);
183188

184189
Assert.IsTrue(actual.TransactionID.Trim().Length > 0);
185-
Assert.IsTrue(long.Parse(actual.TransactionID) > 0);
190+
Assert.Greater(long.Parse(actual.TransactionID), 0);
186191
}
187192

188193
/// <summary>

AuthorizeNETtest/ReportingGatewayTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void Reporting_GetSettledBatchListTest_NoRecord()
146146
/// To run this test, first revoke the "Transaction Details API" permission of your sandbox account.
147147
/// </summary>
148148
[Test]
149-
[Ignore("To run this test, first revoke the \"Transaction Details API\" permission of your sandbox account.")]
149+
[Ignore("To run this test, first revoke the \"Transaction Details API\" permission of your account.")]
150150
public void Reporting_GetTransactionDetailsTest_AccessDenied()
151151
{
152152
//check login / password
@@ -260,7 +260,7 @@ public void Reporting_GetTransactionDetailsTest()
260260
/// Then going to Account / Settings and clicking on the Transaction Details API link.
261261
/// </summary>
262262
[Test]
263-
[Ignore("To run this test, first find a transaction with subscription in the sandbox, and use it to change the transId below.")]
263+
[Ignore("To run this test, find a transaction with subscription, and configure the transId below.")]
264264
public void Reporting_GetTransactionDetailsTest_WithSubscription()
265265
{
266266
const string transId = "???"; // A transaction id with subscription
@@ -314,7 +314,7 @@ public void Reporting_GetTransactionDetailsTest_WithSubscription()
314314
/// Then going to Account / Settings and clicking on the Transaction Details API link.
315315
/// </summary>
316316
[Test]
317-
[Ignore("To run this test, first find a transaction with return items in the sandbox, and use it change the transId below.")]
317+
[Ignore("To run this test, find a transaction with return items, and configure the transId below.")]
318318
public void Reporting_GetTransactionDetailsTest_WithReturnedItems()
319319
{
320320
const string transId = "???"; // A transaction id with returned items
@@ -373,7 +373,7 @@ public void Reporting_GetTransactionDetailsTest_WithReturnedItems()
373373
/// Then going to Account / Settings and clicking on the Transaction Details API link.
374374
/// </summary>
375375
[Test]
376-
[Ignore("To run this test, first find a transaction with solution in the sandbox, and use it to change the transId below.")]
376+
[Ignore("To run this test, find a transaction with solution, and configure the transId below.")]
377377
public void Reporting_GetTransactionDetailsTest_WithSolutionID()
378378
{
379379
const string transId = "???"; // A transaction id with solution.

0 commit comments

Comments
 (0)