Debian Codegraph @

external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderToString.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 ConstructorBuilderToString
10 {
11 [Fact]
12 public void ToString_NullRequiredOptionalCustomModifiers()
13 {
14 TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
15 Type[] parameterTypes = new Type[] { typeof(int), typeof(double) };
16
17 ConstructorBuilder constructor = type.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, parameterTypes, null, null);
18 Assert.StartsWith("Name: .ctor", constructor.ToString());
19 }
20
21 [Fact]
22 public void ToString_NoRequiredOptionalCustomModifiers()
23 {
24 TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
25 Type[] parameterTypes = new Type[] { typeof(int), typeof(double) };
26
27 ConstructorBuilder constructor = type.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, parameterTypes);
28 Assert.StartsWith("Name: .ctor", constructor.ToString());
29 }
30 }
31 }