public void DemeritPointsCalculator_WhenCalled_ReturnDemeritPoints(int speed, int expectedResult) { var demeritPoints = new DemeritPointsCalculator(); var result = demeritPoints.CalculateDemeritPoints(speed); Assert.That(result, Is.EqualTo(expectedResult)); }
public void DemeritPointsCalculator_SpeedIsLessThanZeroOrMoreThan300_ThrowsArgumentOutOfRangeException(int speed) { //arrange var demeritPoints = new DemeritPointsCalculator(); //act //var result = demeritPoints.CalculateDemeritPoints(-10); //assert Assert.That(() => demeritPoints.CalculateDemeritPoints(speed), Throws.Exception.TypeOf <ArgumentOutOfRangeException>()); }