* Remove xunit.runner.console reference
* Replace ExceptionAssert2.ThrowsArgumentNull with ExceptionAssert.ThrowsArgumentNull
This commit is contained in:
parent
f46b3a2db6
commit
6ad27bb705
|
|
@ -21,9 +21,6 @@
|
|||
]
|
||||
},
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"xunit.runner.console": "2.1.0"
|
||||
},
|
||||
"frameworkAssemblies": {
|
||||
"System.Runtime": "",
|
||||
"System.Threading.Tasks": ""
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@
|
|||
]
|
||||
},
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"xunit.runner.console": "2.1.0"
|
||||
},
|
||||
"frameworkAssemblies": {
|
||||
"System.Runtime": "",
|
||||
"System.Threading.Tasks": ""
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@
|
|||
},
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"Moq": "4.2.1312.1622",
|
||||
"xunit.runner.console": "2.1.0"
|
||||
"Moq": "4.2.1312.1622"
|
||||
},
|
||||
"frameworkAssemblies": {
|
||||
"System.Runtime": "",
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
},
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"Moq": "4.2.1312.1622",
|
||||
"xunit.runner.console": "2.1.0"
|
||||
"Moq": "4.2.1312.1622"
|
||||
},
|
||||
"frameworkAssemblies": {
|
||||
"System.Runtime": "",
|
||||
|
|
|
|||
|
|
@ -9,20 +9,6 @@ namespace Microsoft.AspNetCore.Testing
|
|||
{
|
||||
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>
|
||||
/// Verifies that the code throws a <see cref="CryptographicException"/>.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
|
|||
newPurpose: "purpose");
|
||||
|
||||
// Act & assert
|
||||
ExceptionAssert2.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext");
|
||||
ExceptionAssert.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
|
|||
newPurpose: "purpose");
|
||||
|
||||
// Act & assert
|
||||
ExceptionAssert2.ThrowsArgumentNull(() => protector.Unprotect(protectedData: null), "protectedData");
|
||||
ExceptionAssert.ThrowsArgumentNull(() => protector.Unprotect(protectedData: null), "protectedData");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
public void Ctor_Pointer_WithNullPointer_ThrowsArgumentNull()
|
||||
{
|
||||
// Act & assert
|
||||
ExceptionAssert2.ThrowsArgumentNull(
|
||||
ExceptionAssert.ThrowsArgumentNull(
|
||||
testCode: () => new Secret(null, 0),
|
||||
paramName: "secret");
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.DataProtection
|
|||
var secret = Secret.Random(16);
|
||||
|
||||
// Act & assert
|
||||
ExceptionAssert2.ThrowsArgumentNull(
|
||||
ExceptionAssert.ThrowsArgumentNull(
|
||||
testCode: () => secret.WriteSecretIntoBuffer(null, 100),
|
||||
paramName: "buffer");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
},
|
||||
"net451": {
|
||||
"dependencies": {
|
||||
"Moq": "4.2.1312.1622",
|
||||
"xunit.runner.console": "2.1.0"
|
||||
"Moq": "4.2.1312.1622"
|
||||
},
|
||||
"frameworkAssemblies": {
|
||||
"System.Runtime": "",
|
||||
|
|
|
|||
Loading…
Reference in New Issue