public void CompareToIsImplemented() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); Assert.Equal(0, kilogramperjoule.CompareTo(kilogramperjoule)); Assert.True(kilogramperjoule.CompareTo(BrakeSpecificFuelConsumption.Zero) > 0); Assert.True(BrakeSpecificFuelConsumption.Zero.CompareTo(kilogramperjoule) < 0); }
public void CompareToIsImplemented() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); Assert.AreEqual(0, kilogramperjoule.CompareTo(kilogramperjoule)); Assert.Greater(kilogramperjoule.CompareTo(BrakeSpecificFuelConsumption.Zero), 0); Assert.Less(BrakeSpecificFuelConsumption.Zero.CompareTo(kilogramperjoule), 0); }
public void CompareToThrowsOnNull() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed kilogramperjoule.CompareTo(null); }
public void CompareToThrowsOnNull() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); Assert.Throws <ArgumentNullException>(() => kilogramperjoule.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); Assert.Throws <ArgumentException>(() => kilogramperjoule.CompareTo(new object())); }