Arrange, Act, Assert

Set up, do the action, check the result.

What is Arrange, Act, Assert?

Arrange, Act, Assert is the standard shape of a test: set things up, do the one action, check the result.

[Fact]
public void Deposit_AddsToBalance()
{
    var account = new Account();   // Arrange
    account.Deposit(50);            // Act
    Assert.Equal(50, account.Balance); // Assert
}

Level: Novice · More Unit Testing terms at this level

Updated