[Fact] and [Theory]

Defines an xUnit unit test that has no inputs.

Define [Fact]

In xUnit [Fact] creates a unit test that has no inputs.

[Fact]
public void Add_Should_ReturnSum()
{
    // Arrange
    var calculator = new Calculator();
    // Act
    var result = calculator.Add(2, 3);
    // Assert
    Assert.Equal(5, result);
}

Level: Journeyman · More C# terms at this level

Updated