Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nenoNaninu committed Feb 13, 2024
1 parent 10fea5f commit 2c01042
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions tests/Tapper.Tests.Analyzer/AnalyzerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,29 @@ class NotSupport

await VerifyAsync(code, "TAPP004", 7, 28, 7, 38);
}

[Fact]
public async Task Test_GenericType()
{
var code = """
using Tapper;
using System;
public class GenericClass1<T>
{
public string StringProperty { get; set; }
public T GenericProperty { get; set; }
}
[TranspilationSource]
public class NestedGenericClass<T1, T2>
{
public string StringProperty { get; set; }
public T1 GenericProperty { get; set; }
public GenericClass1<T1> GenericClass1Property { get; set; }
}
""";

await VerifyAsync(code, "TAPP001", 15, 30, 15, 51);
}
}
2 changes: 1 addition & 1 deletion tests/Tapper.Tests.Analyzer/Tapper.Tests.Analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2c01042

Please sign in to comment.