Skip to content

xUnit1010: Invalid literal causes invalid reporting #3569

@Vampire2008

Description

@Vampire2008

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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Analyzershttps://github.com/xunit/xunit.analyzersBugA fault in an existing featuregood first issueThis may be a good issue for a first-time contributorhelp wantedA community-provided PR would be welcomed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions