Fix exception type tested for in SignerIdentifierType_InvalidValues (dotnet/corefx...
authorJeremy Barton <jbarton@microsoft.com>
Tue, 25 Jun 2019 13:47:49 +0000 (06:47 -0700)
committerStephen Toub <stoub@microsoft.com>
Tue, 25 Jun 2019 13:47:49 +0000 (09:47 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/df7147a81d664c1462bfa6e7bc2042b2afca4072

src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs

index cd01447..90f6179 100644 (file)
@@ -2,24 +2,23 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System.Linq;
-using System.Security.Cryptography.X509Certificates;
-using System.Security.Cryptography.Xml;
-using Test.Cryptography;
 using Xunit;
 
 namespace System.Security.Cryptography.Pkcs.Tests
 {
-       public static partial class CmsSignerTests
-       {
-        [ActiveIssue(30257)]
-               [Fact]
-               public static void SignerIdentifierType_InvalidValues()
-               {
-                       CmsSigner signer = new CmsSigner();
-                       Assert.ThrowsAny<CryptographicException>(() => signer.SignerIdentifierType = SubjectIdentifierType.Unknown);
-                       Assert.ThrowsAny<CryptographicException>(() => signer.SignerIdentifierType = (SubjectIdentifierType)4);
-                       Assert.ThrowsAny<CryptographicException>(() => signer.SignerIdentifierType = (SubjectIdentifierType)(-1));
-               }
-       }
+    public static partial class CmsSignerTests
+    {
+        [Theory]
+        [InlineData((SubjectIdentifierType)0)]
+        [InlineData((SubjectIdentifierType)4)]
+        [InlineData((SubjectIdentifierType)(-1))]
+        public static void SignerIdentifierType_InvalidValues(SubjectIdentifierType invalidType)
+        {
+            CmsSigner signer = new CmsSigner();
+
+            AssertExtensions.Throws<ArgumentException>(
+                paramName: null,
+                () => signer.SignerIdentifierType = invalidType);
+        }
+    }
 }