# \[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.

```csharp
[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](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: October 12, 2026

Source: https://www.ask-codey.com/glossary/fact-and-theory
