xunit/xunit

xUnit1010 is triggered for strings which are convertible to decimal / int

Fechada

#2.354 aberto em 30 de jul. de 2021

 (6 comentários) (1 reação) (0 responsável)C# (761 forks)batch import
AnalyzersBughelp wanted

Métricas do repositório

Stars
 (3.873 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

        [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).

Guia do colaborador