Skip to content

Commit

Permalink
ApiTest that validates AspNetLayoutRendererBase can never be ThreadAg…
Browse files Browse the repository at this point in the history
…nostic (NLog#872)
  • Loading branch information
snakefoot authored Oct 8, 2022
1 parent 2d0d7eb commit e17ba91
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Shared/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ public void AppDomainFixedOutput_Attribute_EnsureThreadAgnostic()
}
}

[Fact]
public void NoThreadAgnostic_For_HttpContext()
{
foreach (Type type in allTypes)
{
if (typeof(AspNetLayoutRendererBase).IsAssignableFrom(type))
{
var threadAgnosticAttribute = type.GetCustomAttribute<ThreadAgnosticAttribute>();
Assert.True(threadAgnosticAttribute is null, $"{type.ToString()} cannot be [ThreadAgnostic]");
}
}
}

[Fact]
public void RequiredConfigOptionMustBeClass()
{
Expand Down

0 comments on commit e17ba91

Please sign in to comment.