public void ConstructorTest() { EngineSize es = new EngineSize(1.2, 4.6); Assert.AreEqual(1.2, es.Height); Assert.AreEqual(4.6, es.Width); }
public void CopyConstructorTest() { EngineSize es = new EngineSize(1.2, 4.6); EngineSize es2 = new EngineSize(es); Assert.AreEqual(es.Height, es2.Height); Assert.AreEqual(es.Width, es2.Width); }
public void SetSelectedEngineSize_EnterCorrectData_SetEngineSize(string selectedEngineSize, double expectedSize) { EngineSize actualObjectEngineSize = new EngineSize(selectedEngineSize); objectEngineSize.engineSize = expectedSize; Assert.AreEqual(objectEngineSize.engineSize, actualObjectEngineSize.engineSize); }
public int CompareToByEngineSize(Car other) { if (ReferenceEquals(this, other)) { return(0); } return(other is null ? 1 : EngineSize.CompareTo(other.EngineSize)); }
public (int, int, int, int, int) CompareCarProperties(Car other) { var comparisonTuple = ( maxSpeedComparison : MaxSpeed.CompareTo(other.MaxSpeed), accelerationComparison : Acceleration.CompareTo(other.Acceleration), cylinderComparison : Cylinders.CompareTo(other.Cylinders), engineSizeComparison : EngineSize.CompareTo(other.EngineSize), horsePowerComparison : HorsePower.CompareTo(other.HorsePower) ); return(comparisonTuple); }
public void Constructor2Test() { EnginePoint ep = new EnginePoint(1.5, 4.2); EngineSize es = new EngineSize(5.0, 3.3); EngineRectangle er = new EngineRectangle(ep, es); Assert.AreEqual(ep.X, er.X); Assert.AreEqual(ep.Y, er.Y); Assert.AreEqual(es.Height, er.Height); Assert.AreEqual(es.Width, er.Width); Assert.AreEqual(Directions.Wrong, er.Direction); Assert.AreEqual(false, er.IsBarrier); }
public override void BuildEngine() { Console.WriteLine("Input engine size: 1 - 1.8, 2 - 2.0, 3 - 3.0"); string selectedEngineSize = Console.ReadLine(); EngineSize EngineSize = new EngineSize(selectedEngineSize); if (EngineSize.isEngineSizeTrue == true) { car.EngineSize = EngineSize.engineSize; } else { throw new NullReferenceException(); } }
public void ChangeEngineSize(EngineSize engineSize) { switch (engineSize) { case EngineSize.Medium: PencePerMile = 0.108f; this.engineSize = engineSize; break; case EngineSize.Large: PencePerMile = 0.134f; this.engineSize = engineSize; break; default: PencePerMile = 0.093f; this.engineSize = engineSize; break; } }
public Diesel(EngineSize engineSize = EngineSize.Small) { EngineType = "Diesel"; ChangeEngineSize(engineSize); }
public EngineSize(EngineSize es) { this.Height = es.Height; this.Width = es.Width; }
public Petrol(EngineSize engineSize = EngineSize.Small) { EngineType = "Petrol"; ChangeEngineSize(engineSize); }
public void SetEngine(EngineSize engineSize) => engineSize.Equals(EngineSize.OnePointFive);
public void ChangeEngineSize(EngineSize engineSize) => _advisoryFuelRate.ChangeEngineSize(engineSize);
public LPG(EngineSize engineSize = EngineSize.Small) { EngineType = "LPG"; ChangeEngineSize(engineSize); }
public void ChangeEngineSize(EngineSize engineSize) => Console.WriteLine("EMV has only 1 engine size");
public void Print() { Console.WriteLine(Manufacture + " == " + Model + " " + EngineSize.ToString() + " " + FuelType + " >> " + ValveTrainConfig + "\n "); }