public void Test_Equals() { var quadOne = new QuartetAurora("12.3b56"); var quadTwo = new QuartetAurora("12.3b56"); // two instances should be equal Assert.IsTrue(quadOne.Equals(quadTwo)); Assert.IsTrue(quadTwo.Equals(quadOne)); // self equality Assert.IsTrue(quadOne.Equals(quadOne)); Assert.IsTrue(quadTwo.Equals(quadTwo)); }
public void Test_Equals_negative() { // two different numbers should not be equal var quadOne = new QuartetAurora("12.3b5"); var quadTwo = new QuartetAurora("17.1a7"); Assert.IsFalse(quadOne.Equals(quadTwo)); Assert.IsFalse(quadTwo.Equals(quadOne)); quadOne = new QuartetAurora("12.3b4"); quadTwo = new QuartetAurora("15.3b4"); Assert.IsFalse(quadOne.Equals(quadTwo)); Assert.IsFalse(quadTwo.Equals(quadOne)); quadOne = new QuartetAurora("12.3b4"); quadTwo = new QuartetAurora("12.4b4"); Assert.IsFalse(quadOne.Equals(quadTwo)); Assert.IsFalse(quadTwo.Equals(quadOne)); quadOne = new QuartetAurora("12.3a4"); quadTwo = new QuartetAurora("12.3b4"); Assert.IsFalse(quadOne.Equals(quadTwo)); Assert.IsFalse(quadTwo.Equals(quadOne)); quadOne = new QuartetAurora("12.3b5"); quadTwo = new QuartetAurora("12.3b6"); Assert.IsFalse(quadOne.Equals(quadTwo)); Assert.IsFalse(quadTwo.Equals(quadOne)); }