public void EqualsIsImplemented() { Pressure v = Pressure.FromPascals(1); Assert.True(v.Equals(Pressure.FromPascals(1), Pressure.FromPascals(PascalsTolerance))); Assert.False(v.Equals(Pressure.Zero, Pressure.FromPascals(PascalsTolerance))); }
public void EqualsIsImplemented() { Pressure v = Pressure.FromPascals(1); Assert.IsTrue(v.Equals(Pressure.FromPascals(1))); Assert.IsFalse(v.Equals(Pressure.Zero)); }
public void OpEquals() { var pressure1 = new Pressure(1000, PressureUnit.Pascals); var pressure2 = new Pressure(1, PressureUnit.KiloPascals); var pressure3 = new Pressure(2, PressureUnit.KiloPascals); (pressure1 == pressure2).ShouldBeTrue(); (pressure2 == pressure1).ShouldBeTrue(); (pressure1 == pressure3).ShouldBeFalse(); (pressure3 == pressure1).ShouldBeFalse(); pressure1.Equals(pressure2) .ShouldBeTrue(); pressure1.Equals((object)pressure2) .ShouldBeTrue(); pressure2.Equals(pressure1) .ShouldBeTrue(); pressure2.Equals((object)pressure1) .ShouldBeTrue(); }
protected bool Equals(ForecastEntity other) { return(Id == other.Id && string.Equals(City, other.City) && Date.Equals(other.Date) && Pressure.Equals(other.Pressure) && Humidity.Equals(other.Humidity) && TemperatureMorning.Equals(other.TemperatureMorning) && TemperatureDay.Equals(other.TemperatureDay) && TemperatureEvening.Equals(other.TemperatureEvening) && TemperatureNight.Equals(other.TemperatureNight) && WindSpeed.Equals(other.WindSpeed) && string.Equals(Description, other.Description) && string.Equals(Icon, other.Icon)); }
/// <summary> /// Returns true if Forecast instances are equal /// </summary> /// <param name="other">Instance of Forecast to be compared</param> /// <returns>Boolean</returns> public bool Equals(Forecast other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Date == other.Date || Date != null && Date.Equals(other.Date) ) && ( Pressure == other.Pressure || Pressure != null && Pressure.Equals(other.Pressure) ) && ( Humidity == other.Humidity || Humidity != null && Humidity.Equals(other.Humidity) ) && ( WindSpeed == other.WindSpeed || WindSpeed != null && WindSpeed.Equals(other.WindSpeed) ) && ( Clouds == other.Clouds || Clouds != null && Clouds.Equals(other.Clouds) ) && ( Temperature == other.Temperature || Temperature != null && Temperature.Equals(other.Temperature) ) && ( Weather == other.Weather || Weather != null && Weather.Equals(other.Weather) )); }
public void EqualsReturnsFalseOnNull() { Pressure pascal = Pressure.FromPascals(1); Assert.False(pascal.Equals(null)); }
public void EqualsReturnsFalseOnTypeMismatch() { Pressure pascal = Pressure.FromPascals(1); Assert.False(pascal.Equals(new object())); }
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(MainValues other) { return(Temp.Equals(other.Temp) && TempMin.Equals(other.TempMin) && TempMax.Equals(other.TempMax) && Pressure.Equals(other.Pressure) && SeaLevel.Equals(other.SeaLevel) && GroundLevel.Equals(other.GroundLevel) && Humidity.Equals(other.Humidity)); }
public bool Equals(Params other) { return(Region.Equals(other.Region) && Temp.Equals(other.Temp) && Pressure.Equals(other.Pressure) && CurrTime.Equals(other.CurrTime)); }