-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Verify = Microsoft.CodeAnalysis.CSharp.Testing.CSharpAnalyzerVerifier<Bluehill.Analyzers.BH0001TypesShouldBeSealedAnalyzer, Microsoft.CodeAnalysis.Testing.DefaultVerifier>; | ||
|
||
namespace Bluehill.Analyzers.Tests; | ||
|
||
public sealed class BH0001AnalyzerTest { | ||
[Fact] | ||
public Task NonSealedClass() => Verify.VerifyAnalyzerAsync(""" | ||
public class [|TestClass|]; | ||
"""); | ||
|
||
[Fact] | ||
public Task NonSealedAndNonSealedDerivedClass() => Verify.VerifyAnalyzerAsync(""" | ||
public class TestClass; | ||
public class [|TestClass2|] : TestClass; | ||
"""); | ||
|
||
[Fact] | ||
public Task NonSealedAndSealedDerivedClass() => Verify.VerifyAnalyzerAsync(""" | ||
public class TestClass; | ||
public sealed class TestClass2 : TestClass; | ||
"""); | ||
|
||
[Fact] | ||
public Task StaticClass() => Verify.VerifyAnalyzerAsync(""" | ||
public static class TestClass; | ||
"""); | ||
|
||
[Fact] | ||
public Task SealedClassWithoutBase() => Verify.VerifyAnalyzerAsync(""" | ||
public sealed class TestClass; | ||
"""); | ||
|
||
[Fact] | ||
public Task AbstractClassWithoutBase() => Verify.VerifyAnalyzerAsync(""" | ||
public abstract class TestClass; | ||
"""); | ||
|
||
[Fact] | ||
public Task Struct() => Verify.VerifyAnalyzerAsync(""" | ||
public struct TestStruct; | ||
"""); | ||
|
||
[Fact] | ||
public Task Enum() => Verify.VerifyAnalyzerAsync(""" | ||
public enum TestEnum; | ||
"""); | ||
|
||
[Fact] | ||
public Task Interface() => Verify.VerifyAnalyzerAsync(""" | ||
public interface TestInterface; | ||
"""); | ||
|
||
[Fact] | ||
public Task Delegate() => Verify.VerifyAnalyzerAsync(""" | ||
public delegate void TestDelegate(); | ||
"""); | ||
} |
This file was deleted.
Oops, something went wrong.