Skip to content

Commit ac312b6

Browse files
authored
Add tests for TypeForwardedFromAttribute (dotnet#27599)
Fixes #27554
1 parent 281ef75 commit ac312b6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/System.Runtime/tests/System.Runtime.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
<Compile Include="System\Reflection\TypeTests.GetMember.cs" />
166166
<Compile Include="System\Runtime\MemoryFailPointTests.cs" />
167167
<Compile Include="System\Runtime\NgenServicingAttributesTests.cs" />
168+
<Compile Include="System\Runtime\CompilerServices\AttributesTests.cs" />
168169
<Compile Include="System\Runtime\CompilerServices\ConditionalWeakTableTests.cs" />
169170
<Compile Include="System\Runtime\CompilerServices\StrongBoxTests.cs" />
170171
<Compile Include="System\Runtime\CompilerServices\RuntimeHelpersTests.cs" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.Runtime.CompilerServices.Tests
8+
{
9+
public static class AttributesTests
10+
{
11+
[Fact]
12+
public static void TypeForwardedToAttributeTests()
13+
{
14+
string assemblyFullName = "MyAssembly";
15+
var attr = new TypeForwardedFromAttribute(assemblyFullName);
16+
Assert.Equal(assemblyFullName, attr.AssemblyFullName);
17+
18+
AssertExtensions.Throws<ArgumentNullException>("assemblyFullName", () => new TypeForwardedFromAttribute(null));
19+
AssertExtensions.Throws<ArgumentNullException>("assemblyFullName", () => new TypeForwardedFromAttribute(""));
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)