Tests do not work

i try add a new tests in my class test, but the new method just don't work. i use xUnit and MOQ.

enter image description here

[Theory]
[Trait("Category", "Selecao")]
public void teste()
{
    Assert.Empty("");
}

enter image description here

enter image description here

Upvotes: 1

Views: 69

Answers (1)

Daan
Daan

Reputation: 455

Replace [Theory] with [Fact]

A [Theory] must have testdata, like this:

[Theory]
[InlineData(3)]
[InlineData(5)]
[InlineData(6)]
public void MyFirstTheory(int value)
{
    Assert.True(IsOdd(value));
}

For [Fact], this is not needed, example:

[Fact]
public void MyTest()
{
    Assert.Empty("");
}

More info at: http://xunit.github.io/docs/getting-started-desktop#write-first-theory

Upvotes: 7

Related Questions