Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs')
-rw-r--r--src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs b/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs
index a0e00935cd..402fb5569f 100644
--- a/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs
+++ b/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/ProgIdAttributeTests.cs
@@ -2,8 +2,6 @@
// 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.Reflection;
using Xunit;
namespace System.Runtime.InteropServices.Tests
@@ -14,10 +12,18 @@ namespace System.Runtime.InteropServices.Tests
[Fact]
public void Exists()
{
- var type = typeof(ProgIdAttributeTests);
- var attr = type.GetCustomAttributes(typeof(ProgIdAttribute), false).OfType<ProgIdAttribute>().SingleOrDefault();
- Assert.NotNull(attr);
- Assert.Equal("pizza", attr.Value);
+ Type type = typeof(ProgIdAttributeTests);
+ ProgIdAttribute attribute = Assert.IsType<ProgIdAttribute>(Assert.Single(type.GetCustomAttributes(typeof(ProgIdAttribute), false)));
+ Assert.Equal("pizza", attribute.Value);
+ }
+
+ [Theory]
+ [InlineData(null)]
+ [InlineData("ProgId")]
+ public void Ctor_ProgId(string progId)
+ {
+ var attribute = new ProgIdAttribute(progId);
+ Assert.Equal(progId, attribute.Value);
}
}
}