Cannot resolve symbol 'InlineData'

47 Views Asked by At

I'm a engineer student and as I need to use rider to code in C# I also need to use Unitest. The problem is that when I write code like this

public class Pyramid
{
    [Theory]
    [InlineData(1, '*', "*\n")]
    [InlineData(-0.1f, 0f, -3f, -2f, 0f)]
    [InlineData(2f, 3f, 3.4f, 2f, 3.4f)]
    [InlineData(8f, 0f, -1f, 5f, 8f)]
    public static void Tree_Debug(ulong n, char c, string res)
    {
        Assert.Equal(res, DebugMe.Pyramid(n, c));
    }
}

here is my code (it works perfectly and gives a pyramid)

    public static string Pyramid(ulong height, char block)
    {
        string res = "";

        if (height < 1)
        {
            throw new ArgumentException("...");
        }

        for (uint i = 0; i < height; i++)
        {
            string s = "";
            uint j = 1;
            while (j < height - i)
            {
                s += 'O';
                j++;
            }

            res += s;
            for (uint k = 0; k <= i << 1; k++)
            {
                res += block;
            }

            res += s + '\n';
        }

        return res;
    }

InlineData and Equal appears in Red syaing that they 'Cannot resolve symbol 'InlineData'' or Cannot resolve symbol 'Equal'.

My question is: how to solve the bug ?

  • I tried to reload the packages or my rider itself, but nothing's successfull
  • When I try to do it on the school computer it works perfectly (maybe missing packages on my pc or something ?)
0

There are 0 best solutions below