xunit/xunit
xUnit1010 is triggered for strings which are convertible to decimal / int
クローズ
#2,354 opened on 2021/07/30
AnalyzersBughelp wanted
Repository metrics
- Stars
- (3,873 個のスター)
- PR merge metrics
- (30d に merged PR はありません)
説明
[Theory]
#pragma warning disable xUnit1010 // The value is not convertible to the method parameter type
[InlineData("2.234")]
#pragma warning restore xUnit1010 // The value is not convertible to the method parameter type
public void TestAnalyzer(decimal d)
{
Assert.Equal(d, 2.234m);
}
The test above works fine, as string value is converted to decimal internally. Still, xUnit1010 is produced (with Error priority by default).