瀏覽代碼

* Remove xunit.runner.console reference
* Replace ExceptionAssert2.ThrowsArgumentNull with
ExceptionAssert.ThrowsArgumentNull

Pranav K 10 年之前
父節點
當前提交
6ad27bb705

+ 0 - 3
test/Microsoft.AspNetCore.Cryptography.Internal.Test/project.json

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

+ 0 - 3
test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/project.json

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

+ 1 - 2
test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/project.json

@@ -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": "",

+ 1 - 2
test/Microsoft.AspNetCore.DataProtection.Extensions.Test/project.json

@@ -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": "",

+ 0 - 14
test/Microsoft.AspNetCore.DataProtection.Test.Shared/ExceptionAssert2.cs

@@ -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>

+ 2 - 2
test/Microsoft.AspNetCore.DataProtection.Test/KeyManagement/KeyRingBasedDataProtectorTests.cs

@@ -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]

+ 2 - 2
test/Microsoft.AspNetCore.DataProtection.Test/SecretTests.cs

@@ -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");
         }

+ 1 - 2
test/Microsoft.AspNetCore.DataProtection.Test/project.json

@@ -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": "",