Debian Codegraph @

external/corefx/src/System.Reflection.Emit/tests/FieldBuilder/FieldBuilderGetValue.cs

raw
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5 using Xunit;
6
7 namespace System.Reflection.Emit.Tests
8 {
9 public class FieldBuilderGetValue
10 {
11 [Fact]
12 public void GetValue_ThrowsNotSupportedException()
13 {
14 FieldBuilder field = Helpers.DynamicType(TypeAttributes.Abstract).DefineField("TestField", typeof(int), FieldAttributes.Public);
15 Assert.Throws<NotSupportedException>(() => field.GetValue(null));
16 }
17 }
18 }