Skip to content

Commit

Permalink
Add tests for abstract types
Browse files Browse the repository at this point in the history
  • Loading branch information
jontdelorme authored and meziantou committed May 5, 2023
1 parent 142fd38 commit 231489d
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,25 @@ private static ProjectBuilder CreateProjectBuilder()
public async Task Valid(string code)
{
await CreateProjectBuilder()
.WithSourceCode(code)
.ValidateAsync();
.WithSourceCode(code)
.ValidateAsync();
}


[Fact]
public async Task AbstractClass_Valid()
{
const string SourceCode = """
abstract class Test
{
public Test(int a) { }
};
""";

await CreateProjectBuilder().WithOutputKind(OutputKind.DynamicallyLinkedLibrary)
.WithSourceCode(SourceCode)
.ValidateAsync();
}

[Theory]
[InlineData("new object().GetType().GetType();")]
[InlineData("((System.Type)null).GetType();")]
Expand Down

0 comments on commit 231489d

Please sign in to comment.