コード例 #1
0
        public void VerifyThrowError(string carType, double motorPower, int speed)
        {
            var bmwCar = new Before.Car(carType, motorPower);

            var ex = Assert.Throws <Exception>(() => bmwCar.GetSpeed());

            Assert.That(ex.Message, Is.EqualTo("Car type not known"));
        }
コード例 #2
0
        public void VerifyBMWSpeed(string carType, double motorPower, int speed)
        {
            var car = new Before.Car(carType, motorPower);

            var carSpeed = car.GetSpeed();

            Assert.AreEqual(carSpeed, speed);
        }