xunit why basic inlinedata are not provided?
Asked Answered
C

4

5

I don't understand why my test returns :

System.InvalidOperationException : The test method expected 1 parameter value, but 0 parameter values were provided. Exception doesn't have a stacktrace

while my very basic test matches with examples found here and there :

 [Theory]
    [InlineData("‘")]
    [InlineData("«")]
    [InlineData("£")]
    [InlineData("€")]
    [InlineData("à")]
    [InlineData("é")]
    [InlineData("î")]
    [InlineData("ï")]
    public void IsAsciiComplient_Fail(string c)
    {
        //Act
        bool actual = c.IsAsciiComplient();

        //Test
        Assert.False(actual);
    }

I've also tried with char instead of string with no luck.

As there is no stack trace, how can i fixe it please? Any clue on what is going wrong?

Concomitance answered 21/2, 2018 at 11:39 Comment(1)
ok this was a bug with resharper, i've updated resharper to v2017.3.1 , problem solvedConcomitance
J
5

Rebuild whole solution and try again.

Jaramillo answered 16/11, 2018 at 16:55 Comment(0)
C
2

this was a bug with resharper, i updated resharper to v2017.3.1 then the problem was fixed.

Concomitance answered 21/2, 2018 at 13:20 Comment(0)
S
1

I ran into this when I had two tests with the same name, one being a Theory and one being a Fact. Giving the Theory a unique name fixed the issue.

Stint answered 4/12, 2020 at 21:39 Comment(0)
A
1

I ran into this issue with Visual Studio 17.3 Test Explorer (but not ReSharper) and xUnit when I had subclassed xUnit's TheoryAttribute because I wanted to provide custom skipping logic. Reverting to using [Theory] instead of my subclass resolved it for me. Thanks to B. Collins' answer for giving me an idea of what might be wrong.

Anesthetist answered 9/10, 2022 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.