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.

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

Updated

In other subjects