* Remove xunit.runner.console reference

* Replace ExceptionAssert2.ThrowsArgumentNull with
 ExceptionAssert.ThrowsArgumentNull
This commit is contained in:
Pranav K 2016-03-15 11:12:03 -07:00
parent f46b3a2db6
commit 6ad27bb705
8 changed files with 7 additions and 30 deletions

View File

@ -21,9 +21,6 @@
] ]
}, },
"net451": { "net451": {
"dependencies": {
"xunit.runner.console": "2.1.0"
},
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "", "System.Runtime": "",
"System.Threading.Tasks": "" "System.Threading.Tasks": ""

View File

@ -19,9 +19,6 @@
] ]
}, },
"net451": { "net451": {
"dependencies": {
"xunit.runner.console": "2.1.0"
},
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "", "System.Runtime": "",
"System.Threading.Tasks": "" "System.Threading.Tasks": ""

View File

@ -20,8 +20,7 @@
}, },
"net451": { "net451": {
"dependencies": { "dependencies": {
"Moq": "4.2.1312.1622", "Moq": "4.2.1312.1622"
"xunit.runner.console": "2.1.0"
}, },
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "", "System.Runtime": "",

View File

@ -24,8 +24,7 @@
}, },
"net451": { "net451": {
"dependencies": { "dependencies": {
"Moq": "4.2.1312.1622", "Moq": "4.2.1312.1622"
"xunit.runner.console": "2.1.0"
}, },
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "", "System.Runtime": "",

View File

@ -9,20 +9,6 @@ namespace Microsoft.AspNetCore.Testing
{ {
internal static class ExceptionAssert2 internal static class ExceptionAssert2
{ {
/// <summary>
/// Verifies that the code throws an <see cref="ArgumentNullException"/>.
/// </summary>
/// <param name="testCode">A delegate to the code to be tested</param>
/// <param name="paramName">The name of the parameter that should throw the exception</param>
/// <returns>The <see cref="ArgumentNullException"/> that was thrown, when successful</returns>
/// <exception>Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown</exception>
public static ArgumentNullException ThrowsArgumentNull(Action testCode, string paramName)
{
var ex = Assert.Throws<ArgumentNullException>(testCode);
Assert.Equal(paramName, ex.ParamName);
return ex;
}
/// <summary> /// <summary>
/// Verifies that the code throws a <see cref="CryptographicException"/>. /// Verifies that the code throws a <see cref="CryptographicException"/>.
/// </summary> /// </summary>

View File

@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
newPurpose: "purpose"); newPurpose: "purpose");
// Act & assert // Act & assert
ExceptionAssert2.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext"); ExceptionAssert.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext");
} }
[Fact] [Fact]
@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
newPurpose: "purpose"); newPurpose: "purpose");
// Act & assert // Act & assert
ExceptionAssert2.ThrowsArgumentNull(() => protector.Unprotect(protectedData: null), "protectedData"); ExceptionAssert.ThrowsArgumentNull(() => protector.Unprotect(protectedData: null), "protectedData");
} }
[Fact] [Fact]

View File

@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.DataProtection
public void Ctor_Pointer_WithNullPointer_ThrowsArgumentNull() public void Ctor_Pointer_WithNullPointer_ThrowsArgumentNull()
{ {
// Act & assert // Act & assert
ExceptionAssert2.ThrowsArgumentNull( ExceptionAssert.ThrowsArgumentNull(
testCode: () => new Secret(null, 0), testCode: () => new Secret(null, 0),
paramName: "secret"); paramName: "secret");
} }
@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.DataProtection
var secret = Secret.Random(16); var secret = Secret.Random(16);
// Act & assert // Act & assert
ExceptionAssert2.ThrowsArgumentNull( ExceptionAssert.ThrowsArgumentNull(
testCode: () => secret.WriteSecretIntoBuffer(null, 100), testCode: () => secret.WriteSecretIntoBuffer(null, 100),
paramName: "buffer"); paramName: "buffer");
} }

View File

@ -24,8 +24,7 @@
}, },
"net451": { "net451": {
"dependencies": { "dependencies": {
"Moq": "4.2.1312.1622", "Moq": "4.2.1312.1622"
"xunit.runner.console": "2.1.0"
}, },
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "", "System.Runtime": "",