public void EqualsIsImplemented() { Density v = Density.FromKilogramsPerCubicMeter(1); Assert.True(v.Equals(Density.FromKilogramsPerCubicMeter(1))); Assert.False(v.Equals(Density.Zero)); }
public void ShouldReturnFalseWhenInstanceIsNotEqual() { var first = new Density(10, 5); var second = new Density(5, 10); Assert.IsFalse(first.Equals(second)); }
public void ShouldReturnFalseWhenObjectIsNotEqual() { var first = new Density(10, 5); var second = new Density(5, 10); Assert.IsFalse(first.Equals((object)second)); }
public void ShouldReturnTrueWhenInstanceIsEqual() { var first = new Density(50); var second = new Density(50); Assert.IsTrue(first.Equals(second)); }
public void ShouldReturnTrueWhenObjectIsEqual() { var first = new Density(50); var second = new Density(50); Assert.IsTrue(first.Equals((object)second)); }
public void Test_IEquatable() { Density first = new Density(50.0); Density second = new Density(50); Assert.IsTrue(first == second); Assert.IsTrue(first.Equals(second)); Assert.IsTrue(first.Equals((object)second)); first = new Density(50.0); second = new Density(50, DensityUnit.PixelsPerCentimeter); Assert.IsFalse(first == second); Assert.IsFalse(first.Equals(second)); Assert.IsFalse(first.Equals((object)second)); Assert.IsFalse(first == null); Assert.IsFalse(first.Equals(null)); Assert.IsFalse(first.Equals((object)null)); }
public bool Equals(PhysicalProperties other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Enabled == other.Enabled && Density.Equals(other.Density) && Friction.Equals(other.Friction) && Elasticity.Equals(other.Elasticity) && FrictionWeight.Equals(other.FrictionWeight) && ElasticityWeight.Equals(other.ElasticityWeight)); }
public void EqualsReturnsFalseOnNull() { Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1); Assert.False(kilogrampercubicmeter.Equals(null)); }
public void EqualsReturnsFalseOnTypeMismatch() { Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1); Assert.False(kilogrampercubicmeter.Equals(new object())); }
public void ShouldReturnTrueWhenObjectIsTheSame() { var density = new Density(50); Assert.IsTrue(density.Equals((object)density)); }
public void ShouldReturnTrueWhenInstanceIsTheSame() { var density = new Density(50); Assert.IsTrue(density.Equals(density)); }
public void ShouldReturnFalseWhenInstanceIsNull() { var density = new Density(50); Assert.IsFalse(density.Equals(null)); }
public bool Equals(DisplayInfo other) => Width.Equals(other.Width) && Height.Equals(other.Height) && Density.Equals(other.Density) && Orientation.Equals(other.Orientation) && Rotation.Equals(other.Rotation);