-
Notifications
You must be signed in to change notification settings - Fork 5
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 #8 from mskcc/develop
Merging development into master.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 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
77 changes: 77 additions & 0 deletions
77
Medidata.RWS.Tests/Integration/SecurityProtocolTest_MedidataRAVE_06JAN18.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,77 @@ | ||
using System; | ||
using System.Net; | ||
using Medidata.RWS.Core.Exceptions; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Medidata.RWS.Core.Requests; | ||
using Medidata.RWS.Core.Responses; | ||
|
||
namespace Medidata.RWS.Tests.Integration | ||
{ | ||
[TestClass] | ||
public class SecurityProtocolTest_MedidataRAVE_06JAN18 | ||
{ | ||
readonly string MEDIDATA_RAVE_TLS_TEST_SITE = "secops-rave-test"; | ||
protected RwsConnection rws; | ||
protected SecurityProtocolType defaultSecurityProtocolType; | ||
[TestInitialize] | ||
public void InitRwsConn() | ||
{ | ||
defaultSecurityProtocolType = ServicePointManager.SecurityProtocol; | ||
rws = new RwsConnection(MEDIDATA_RAVE_TLS_TEST_SITE); | ||
} | ||
|
||
|
||
[TestMethod] | ||
[ExpectedException(typeof(RWSException))] | ||
public void SSL_BasicRWSRequest_ShouldExceptionWithStatusCode0() | ||
{ | ||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; | ||
var response = rws.SendRequest(new VersionRequest()) as RWSTextResponse; | ||
Assert.Fail(); | ||
} | ||
[TestMethod] | ||
[ExpectedException(typeof(RWSException))] | ||
public void TLS10_BasicRWSRequest_ShouldExceptionWithStatusCode0() | ||
{ | ||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; | ||
var response = rws.SendRequest(new VersionRequest()) as RWSTextResponse; | ||
Assert.Fail(); | ||
} | ||
[TestMethod] | ||
[ExpectedException(typeof(RWSException))] | ||
public void TLS11_BasicRWSRequest_ShouldExceptionWithStatusCode0() | ||
{ | ||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11; | ||
var response = rws.SendRequest(new VersionRequest()) as RWSTextResponse; | ||
Assert.Fail(); | ||
} | ||
|
||
[TestMethod] | ||
[ExpectedException(typeof(RWSException))] | ||
public void DotNetDefault_BasicRWSRequest_ShouldExceptionWithStatusCode0() | ||
{ | ||
ServicePointManager.SecurityProtocol = defaultSecurityProtocolType; | ||
var response = rws.SendRequest(new VersionRequest()) as RWSTextResponse; | ||
Assert.Fail(); | ||
} | ||
[TestMethod] | ||
public void TLS12_BasicRWSRequest_ShouldReturnTextResponse() | ||
{ | ||
try | ||
{ | ||
var response = rws.SendRequest(new VersionRequest()) as RWSTextResponse; | ||
var expected = "1.16.0"; | ||
var actual = response.ResponseText; | ||
Assert.AreEqual(expected, actual); | ||
} | ||
catch (RWSException rwse) | ||
{ | ||
Assert.Fail(rwse.Message); | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
} | ||
} |
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