# Assertion

*noun*

say it: **“uh-SER-shun”** **/əˈsɜːrʃən/**

The line in a test that checks a result is what you expected, failing the test if it isn't.

## What is **Assertion**?

An **assertion** checks that a result is what you expect; if not, the test fails with a message.

```csharp
Assert.Equal(108m, PriceCalculator.WithTax(100m));
```

## In a sentence

- “The **assertion** Assert.AreEqual(10.70m, total) failed with 10.00.”

Level: Novice · [More Unit Testing terms at this level](https://www.ask-codey.com/glossary?category=unit-testing&level=1)

Updated: November 9, 2026

## In other subjects

- [Assertion in Java](https://www.ask-codey.com/glossary/assertion)

Source: https://www.ask-codey.com/glossary/assertion-unit-testing
