Exemple #1
0
	void ExpectOperationSucceeds(Op && op, int expectedGear, int expectedSpeed, bool engineIsOn = true)
	{
		BOOST_CHECK(op());

		BOOST_CHECK_EQUAL(car.IsEngineOn(), engineIsOn);
		BOOST_CHECK_EQUAL(car.GetGear(), expectedGear);
		BOOST_CHECK_EQUAL(car.GetSpeed(), abs(expectedSpeed));
		BOOST_CHECK(car.GetMovementType() == (expectedSpeed > 0 ? (expectedGear > 0 ? CCar::MovementType::FORWARD : expectedGear == 0 ? CCar::MovementType::NONE : CCar::MovementType::BACK) : CCar::MovementType::STAY));
	}
Exemple #2
0
	void ExpectOperationFails(Op && op)
	{
		const CCar clone(car);

		BOOST_CHECK(!op());

		BOOST_CHECK_EQUAL(car.IsEngineOn(), clone.IsEngineOn());
		BOOST_CHECK_EQUAL(car.GetGear(), clone.GetGear());
		BOOST_CHECK_EQUAL(car.GetSpeed(), clone.GetSpeed());
		BOOST_CHECK_EQUAL(car.GetMovementType(), clone.GetMovementType());
	}