Example #1
0
        public void DemeritPointsCalculator_WhenCalled_ReturnDemeritPoints(int speed, int expectedResult)
        {
            var demeritPoints = new DemeritPointsCalculator();

            var result = demeritPoints.CalculateDemeritPoints(speed);

            Assert.That(result, Is.EqualTo(expectedResult));
        }
Example #2
0
        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>());
        }