diff options
Diffstat (limited to 'src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs')
-rw-r--r-- | src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs b/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs index 970ebac13a..4333ea8634 100644 --- a/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs +++ b/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs @@ -21,6 +21,15 @@ namespace System.Reflection.Emit.Tests } [Fact] + public void IsAssignableFrom() + { + EnumBuilder enumBuilder = Helpers.DynamicEnum(TypeAttributes.Public, typeof(int)); + Assert.False(enumBuilder.IsAssignableFrom(null)); + Assert.True(enumBuilder.IsAssignableFrom(typeof(int).GetTypeInfo())); + Assert.False(enumBuilder.IsAssignableFrom(typeof(short).GetTypeInfo())); + } + + [Fact] public void GetElementType_ThrowsNotSupportedException() { EnumBuilder enumBuilder = Helpers.DynamicEnum(TypeAttributes.Public, typeof(int)); |