Skip to content

Commit c637282

Browse files
committed
Merge pull request #1569 from sharwell/attribute-tests
Add tests for NoCodeFixAttribute and NoDiagnosticAttribute
2 parents ac6ba5b + 37f88c8 commit c637282

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Test
5+
{
6+
using Xunit;
7+
8+
public class AttributeTests
9+
{
10+
[Fact]
11+
public void TestNoCodeFixAttributeReason()
12+
{
13+
string reason = "Reason";
14+
var attribute = new NoCodeFixAttribute(reason);
15+
Assert.Same(reason, attribute.Reason);
16+
}
17+
18+
[Fact]
19+
public void TestNoDiagnosticAttributeReason()
20+
{
21+
string reason = "Reason";
22+
var attribute = new NoDiagnosticAttribute(reason);
23+
Assert.Same(reason, attribute.Reason);
24+
}
25+
}
26+
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
</Reference>
114114
</ItemGroup>
115115
<ItemGroup>
116+
<Compile Include="AttributeTests.cs" />
116117
<Compile Include="DocumentationRules\FileHeaderTestBase.cs" />
117118
<Compile Include="DocumentationRules\InheritdocCodeFixProviderUnitTests.cs" />
118119
<Compile Include="DocumentationRules\NoXmlFileHeaderUnitTests.cs" />

0 commit comments

Comments
 (0)