Lesson contents

Test boundary values

Try a value just below the limit and then the limit itself. The two answers show whether the boundary belongs inside or outside the rule.

Simple example

Check one below and exactly at three.

Start2 and 3 · limit 3
ResultFalse True
Program.cs
using System;

Console.WriteLine(2 >= 3);
Console.WriteLine(3 >= 3);
Output
False
True
Advertisements

Everyday examples

A free ticket starts at ten visits. Check a card with nine visits and a card with ten.

Start9 and 10 · limit 10
ResultFalse True
Program.cs
using System;

Console.WriteLine(9 >= 10);
Console.WriteLine(10 >= 10);
Output
False
True
Run the example
Terminal
dotnet new console --output Lesson
cp Program.cs Lesson/Program.cs
dotnet run --project Lesson
Official documentation