public void Decorate_CarProps_SlowdownProps() { CarProps testProps = new CarProps(); testProps.MaxVelocity = 375f; bool result = false; testProps = new SlowdownProps(testProps, null); if (testProps.MaxVelocity == 250f) { result = true; } Assert.IsTrue(result); }
public void Decorate_CarProps_BoostProps() { CarProps testProps = new CarProps(); testProps.MaxVelocity = 400f; testProps.MaxEngineForce = 250f; bool result = false; testProps = new BoostProps(testProps, null); if (testProps.MaxVelocity == 600f && testProps.MaxEngineForce == 500f) { result = true; } Assert.IsTrue(result); }
public void TestInstantiatingCarProps() { var carProps = new CarProps(null); var result = false; if (carProps.MaxEngineForce == 430000f && carProps.MaxVelocity == 480f && carProps.MaxVelocityReverse == -250f && carProps.MaxSteeringAngle == 25f && carProps.MaxBreakingForce == 500000f && carProps.MaxFuelLevel == 35f && carProps.IdleFuelConsumption == 1f && carProps.DrivingFuelConsumption == 3f) { result = true; } Assert.IsTrue(result); }
/// <summary> /// Testing ctor. /// </summary> /// <param name="props"></param> /// <param name="owner"></param> public BoostProps(CarProps props, Car owner) : base(props, owner) { }
/// <summary> /// Default ctor. /// </summary> /// <param name="props"></param> public BoostProps(CarProps props) : base(props) { }
/// <summary> /// Testing ctor. /// </summary> /// <param name="props"></param> /// <param name="owner"></param> public SlowdownProps(CarProps props, Car owner) : base(props, owner) { }
/// <summary> /// Default ctor. /// </summary> /// <param name="props"></param> public SlowdownProps(CarProps props) : base(props) { }