-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Vantiv/US268420-Add-Timeout-Setting-11.0
Us268420 add timeout setting 11.0
- Loading branch information
Showing
10 changed files
with
220 additions
and
17 deletions.
There are no files selected for viewing
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
106 changes: 106 additions & 0 deletions
106
LitleSdkForNet/LitleSdkForNetTest/Functional/TestTimeout.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 |
---|---|---|
@@ -0,0 +1,106 @@ | ||
using System.Collections.Generic; | ||
using System.Net; | ||
using NUnit.Framework; | ||
|
||
namespace Litle.Sdk.Test.Functional { | ||
[TestFixture] | ||
internal class TestTimeout | ||
{ | ||
private LitleOnline _cnp; | ||
private Dictionary<string, string> _config; | ||
|
||
[Test] | ||
public void TestTimeoutNotDefined() | ||
{ | ||
_config = new Dictionary<string, string> | ||
{ | ||
{"url", Properties.Settings.Default.url}, | ||
{"reportGroup", "Default Report Group"}, | ||
{"username", "DOTNET"}, | ||
{"version", "11.0"}, | ||
{"merchantId", "101"}, | ||
{"password", "TESTCASE"}, | ||
{"printxml", "true"}, | ||
{"proxyHost", Properties.Settings.Default.proxyHost}, | ||
{"proxyPort", Properties.Settings.Default.proxyPort}, | ||
{"logFile", Properties.Settings.Default.logFile}, | ||
{"neuterAccountNums", "true"} | ||
}; | ||
|
||
_cnp = new LitleOnline(_config); | ||
|
||
var registerTokenRequest = new registerTokenRequestType | ||
{ | ||
id = "1", | ||
reportGroup = "Planets", | ||
orderId = "12344", | ||
accountNumber = "1233456789103801", | ||
}; | ||
|
||
var rtokenResponse = _cnp.RegisterToken(registerTokenRequest); | ||
StringAssert.AreEqualIgnoringCase("Account number was successfully registered", rtokenResponse.message); | ||
} | ||
|
||
[Test] | ||
public void TestTimeoutNotParsable() | ||
{ | ||
_config = new Dictionary<string, string> | ||
{ | ||
{"url", Properties.Settings.Default.url}, | ||
{"reportGroup", "Default Report Group"}, | ||
{"username", "DOTNET"}, | ||
{"version", "11.0"}, | ||
{"timeout", "notparsableasint"}, | ||
{"merchantId", "101"}, | ||
{"password", "TESTCASE"}, | ||
{"printxml", "true"}, | ||
{"proxyHost", Properties.Settings.Default.proxyHost}, | ||
{"proxyPort", Properties.Settings.Default.proxyPort}, | ||
{"logFile", Properties.Settings.Default.logFile}, | ||
{"neuterAccountNums", "true"} | ||
}; | ||
|
||
_cnp = new LitleOnline(_config); | ||
|
||
var registerTokenRequest = new registerTokenRequestType | ||
{ | ||
id = "1", | ||
reportGroup = "Planets", | ||
orderId = "12344", | ||
accountNumber = "1233456789103801", | ||
}; | ||
|
||
var rtokenResponse = _cnp.RegisterToken(registerTokenRequest); | ||
StringAssert.AreEqualIgnoringCase("Account number was successfully registered", rtokenResponse.message); | ||
} | ||
|
||
[Test] | ||
public void TestTimeoutReached() { | ||
_config = new Dictionary<string, string> { | ||
{"url", Properties.Settings.Default.url}, | ||
{"reportGroup", "Default Report Group"}, | ||
{"username", "DOTNET"}, | ||
{"version", "11.0"}, | ||
{"timeout", "0"}, | ||
{"merchantId", "101"}, | ||
{"password", "TESTCASE"}, | ||
{"printxml", "true"}, | ||
{"proxyHost", Properties.Settings.Default.proxyHost}, | ||
{"proxyPort", Properties.Settings.Default.proxyPort}, | ||
{"logFile", Properties.Settings.Default.logFile}, | ||
{"neuterAccountNums", "true"} | ||
}; | ||
|
||
_cnp = new LitleOnline(_config); | ||
|
||
var registerTokenRequest = new registerTokenRequestType { | ||
id = "1", | ||
reportGroup = "Planets", | ||
orderId = "12344", | ||
accountNumber = "1233456789103801", | ||
}; | ||
|
||
Assert.Throws<WebException>(() => { _cnp.RegisterToken(registerTokenRequest); }); | ||
} | ||
} | ||
} |
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
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