public void EqualsIsImplemented() { Speed v = Speed.FromMetersPerSecond(1); Assert.True(v.Equals(Speed.FromMetersPerSecond(1), Speed.FromMetersPerSecond(MetersPerSecondTolerance))); Assert.False(v.Equals(Speed.Zero, Speed.FromMetersPerSecond(MetersPerSecondTolerance))); }
public void EqualsIsImplemented() { Speed v = Speed.FromMetersPerSecond(1); Assert.IsTrue(v.Equals(Speed.FromMetersPerSecond(1))); Assert.IsFalse(v.Equals(Speed.Zero)); }
public void EqualsSpeedTest() { Speed target = new Speed(10F); Speed obj = new Speed(10F); bool expected = true; bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
public void OpEquals() { var speed1 = new Speed(3600, SpeedUnit.MetersPerHour); var speed2 = new Speed(60, SpeedUnit.MetersPerMinute); var speed3 = new Speed(120, SpeedUnit.MetersPerMinute); (speed1 == speed2).ShouldBeTrue(); (speed2 == speed1).ShouldBeTrue(); (speed1 == speed3).ShouldBeFalse(); (speed3 == speed1).ShouldBeFalse(); speed1.Equals(speed2) .ShouldBeTrue(); speed1.Equals((object)speed2) .ShouldBeTrue(); speed2.Equals(speed1) .ShouldBeTrue(); speed2.Equals((object)speed1) .ShouldBeTrue(); }
public void EqualsDoubleTest() { Speed target = new Speed(10F); double obj = 10F; bool expected = true; bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
internal void Update(LocomotiveInformation locomotiveInformation) { if (Speed.Equals(locomotiveInformation.TrainSpeed) && Functions == locomotiveInformation.TrainFunctions) { return; } Speed = locomotiveInformation.TrainSpeed; Functions = locomotiveInformation.TrainFunctions; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("All!")); }
public void ZeroUnitsSpeed_ShouldBeEqualToZeroMetresPerSecond() { // arrange var zeroMetresPerSecondSpeed = new Speed(Constants.Zero); var zeroUnitsSpeed = new Speed(Constants.Zero, CreateUnitOtherThan(SpeedUnit.MetrePerSecond)); // act // assert zeroMetresPerSecondSpeed.Equals(zeroUnitsSpeed).Should().BeTrue(because: "'new Speed(Constants.Zero)' should be equal 'new Speed(Constants.Zero, SomeUnit)'"); zeroUnitsSpeed.Equals(zeroMetresPerSecondSpeed).Should().BeTrue(because: "'new Speed(Constants.Zero, SomeUnit)' should be equal 'new Speed(Constants.Zero)'"); }
public void SpeedCreateUsingParamlessConstructor_ShouldBeEqualToZeroMetresPerSecond() { // arrange var zeroMetresPerSecondSpeed = new Speed(Constants.Zero); var paramlessConstructedSpeed = new Speed(); // act // assert zeroMetresPerSecondSpeed.Equals(paramlessConstructedSpeed).Should().BeTrue(because: "'new Speed(Constants.Zero)' should be equal 'new Speed()'"); paramlessConstructedSpeed.Equals(zeroMetresPerSecondSpeed).Should().BeTrue(because: "'new Speed()' should be equal 'new Speed(Constants.Zero)'"); }
public void DefaultSpeed_ShouldBeEqualToZeroMetresPerSecond() { // arrange var defaultSpeed = default(Speed); var zeroMetresPerSecondSpeed = new Speed(Constants.Zero); // act // assert zeroMetresPerSecondSpeed.Equals(defaultSpeed).Should().BeTrue(because: "'new Speed(Constants.Zero)' should be equal 'default(Speed)'"); defaultSpeed.Equals(zeroMetresPerSecondSpeed).Should().BeTrue(because: "'default(Speed)' should be equal 'new Speed(Constants.Zero)'"); }
public void SpeedsConvertedToDifferentUnitsEqualInMetresPerSecond_ShouldBeEqual() { // arrange var length1 = new Speed(Fixture.Create <number>()).Convert(Fixture.Create <SpeedUnit>()); var length2 = new Speed(length1.MetresPerSecond).Convert(CreateUnitOtherThan(length1.Unit)); // act bool equalsResult = length1.Equals(length2); // assert equalsResult.Should().BeTrue(); }
protected bool Equals(ForecastDailyEntry o) { return(UnixTimestamp == o.UnixTimestamp && Temp.Equals(o.Temp) && Pressure.Equals(o.Pressure) && Humidity == o.Humidity && WeatherDescription.SequenceEqual(o.WeatherDescription) && Speed.Equals(o.Speed) && Deg == o.Deg && Clouds == o.Clouds && Rain.Equals(o.Rain)); }
protected bool Equals(Wind other) { return(Speed.Equals(other.Speed) && Deg.Equals(other.Deg)); }
/// <summary> /// Compares the current instance to the specified velocity. /// </summary> /// <param name="other">A <strong>Velocity</strong> object to compare with.</param> /// <returns>A <strong>Boolean</strong>, <strong>True</strong> if the values are identical.</returns> public bool Equals(Velocity other) { return(_Speed.Equals(other.Speed) && _Bearing.Equals(other.Bearing)); }
/// <summary> /// Determines whiter if the givenn position equals the current position. /// </summary> /// <param name="position"></param> /// <returns></returns> public bool EqualsPosition(RoutePosition position) { return(Latitude.Equals(position.Latitude) && Longitude.Equals(position.Longitude) && Speed.Equals(position.Speed)); }
public void EqualsReturnsFalseOnTypeMismatch() { Speed meterpersecond = Speed.FromMetersPerSecond(1); Assert.False(meterpersecond.Equals(new object())); }
protected bool Equals(EffectSettings other) { return(Speed.Equals(other.Speed) && Equals(PatternRow, other.PatternRow)); }
public void EqualsReturnsFalseOnNull() { Speed meterpersecond = Speed.FromMetersPerSecond(1); Assert.False(meterpersecond.Equals(null)); }
protected override bool EqualsCore(Balance other) { return(base.Equals(other) && Health.Equals(other.Health) && Power.Equals(other.Power) && Speed.Equals(other.Speed) && string.Equals(Name, other.Name)); }