xunit/xunit

xUnit1010: Invalid literal causes invalid reporting

已关闭

#3,569 创建于 2026年5月5日

 (5 条评论) (0 个反应) (0 位负责人)C# (761 个派生)batch import
AnalyzersBuggood first issuehelp wanted

仓库指标

星标
 (3,873 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Hello! I get xUnit1010 error when parameters in test decimal and Enum.

Simple code:

public enum MyEnum
{
    Value1,
    Value2,
    Value3
}

public class UnitTest1
{
    [Theory]
    [InlineData(1.1m, MyEnum.Value1)]
    public void Test1(decimal param1, MyEnum param2)
    {
        Assert.True(true);
    }
}

Error displays on enum parameter but text referenced to first:

The value is not convertible to the method parameter 'param1' of type 'decimal'. Use a compatible data value.

贡献者指南