public void ComparingT2ValueWithNull_ResultsInNotEqual() { var a = new Union<int, string>(null); IsFalse(a.Equals(null)); IsTrue(a != null); IsTrue(null != a); }
public void DifferentT3Values_ArentEqual() { var a = new Union<int, string, Colors>(Colors.Blue); var b = new Union<int, string, Colors>(Colors.Green); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void DifferentT2Values_ArentEqual() { var a = new Union<int, string>("a"); var b = new Union<int, string>("b"); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void DifferentT4Values_ArentEqual() { var a = new Union<int, string, Colors, Animals>(Animals.Cat); var b = new Union<int, string, Colors, Animals>(Animals.Cow); IsFalse(a.Equals(b)); IsFalse(a == b); }
public void DifferentT3Values_ArentEqual() { var a = new Union<int, string, Colors, Animals>(Colors.Blue); var b = new Union<int, string, Colors, Animals>(Colors.Red); IsFalse(a.Equals(b)); IsFalse(a == b); }
public void DifferentT2Values_ArentEqual() { var a = new Union<int, string, Colors>("abc"); var b = new Union<int, string, Colors>("def"); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void ComparingT4ValueWithNull_ResultsInNotEqual() { var a = new Union <int, string, Colors, Animals>(Animals.Dog); IsFalse(a.Equals(null)); IsTrue(a != null); IsTrue(null != a); }
public void DifferentT3Values_ArentEqual() { var a = new Union <int, string, Colors, Animals>(Colors.Blue); var b = new Union <int, string, Colors, Animals>(Colors.Red); IsFalse(a.Equals(b)); IsFalse(a == b); }
public void DifferentT4Values_ArentEqual() { var a = new Union <int, string, Colors, Animals>(Animals.Cat); var b = new Union <int, string, Colors, Animals>(Animals.Cow); IsFalse(a.Equals(b)); IsFalse(a == b); }
public void DifferentValues_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union<int, string>(0); var b = new Union<int, string>("1234"); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void SameT2Values_AreEqualAndHaveSameHashCode() { var a = new Union<int, string>("1234"); var b = new Union<int, string>("1234"); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void EqalsObj_ReturnsCorrectResult(Union <int, double, string> x, object y, bool expected) { // Act bool er = x.Equals(y); // Assert er.Should().Be(expected); }
public void SameT4Values_AreEqualAndHaveSameHashCode() { var a = new Union<int, string, Colors, Animals>(Animals.Cat); var b = new Union<int, string, Colors, Animals>(Animals.Cat); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void DifferentT2Values_ArentEqual() { var a = new Union <int, string, Colors, Animals>("abc"); var b = new Union <int, string, Colors, Animals>("def"); IsFalse(a.Equals(b)); IsFalse(a == b); }
public void DifferentT1Values_ArentEqual() { var a = new Union <int, string, Colors>(1); var b = new Union <int, string, Colors>(2); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void DifferentT2Values_ArentEqual() { var a = new Union <int, string>("a"); var b = new Union <int, string>("b"); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void DifferentT1T3Values_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union<int, string, Colors>(0); var b = new Union<int, string, Colors>(Colors.Green); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void ComparingT3ValueWithNull_ResultsInNotEqual() { var a = new Union <int, string, Colors>(Colors.Red); IsFalse(a.Equals(null)); IsTrue(a != null); IsTrue(null != a); }
public void SameT3Values_AreEqualAndHaveSameHashCode() { var a = new Union<int, string, Colors>(Colors.Blue); var b = new Union<int, string, Colors>(Colors.Blue); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void ComparingT1ValueWithNull_ResultsInNotEqual() { var a = new Union <int, string>(1); IsFalse(a.Equals(null)); IsTrue(a != null); IsTrue(null != a); }
public void DifferentT3Values_ArentEqual() { var a = new Union <int, string, Colors>(Colors.Blue); var b = new Union <int, string, Colors>(Colors.Green); IsFalse(a.Equals(b)); IsTrue(a != b); }
public void SameT3Values_AreEqualAndHaveSameHashCode() { var a = new Union <int, string, Colors>(Colors.Blue); var b = new Union <int, string, Colors>(Colors.Blue); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void UnionEqualsSameUnion() { Union<Item, DataUnit> union1 = new Union<Item, DataUnit>.Case1(new Item(42)); Union<Item, DataUnit> union2 = new Union<Item, DataUnit>.Case1(new Item(42)); Assert.True(union1.Equals(union2)); Assert.True(union2.Equals(union1)); Assert.True(union1 == union2); Assert.True(union2 == union1); }
public void SameT2Values_AreEqualAndHaveSameHashCode() { var a = new Union <int, string>("1234"); var b = new Union <int, string>("1234"); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void UnionIsNotEqualToStructurallyInequalUnion() { Union<Item, DataUnit> union1 = new Union<Item, DataUnit>.Case1(new Item(42)); Union<Item, DataUnit> union2 = new Union<Item, DataUnit>.Case2(new DataUnit(42)); Assert.False(union1.Equals(union2)); Assert.False(union2.Equals(union1)); Assert.True(union1 != union2); Assert.True(union2 != union1); }
public void DifferentT1T2Values_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union <int, string, Colors, Animals>(2); var b = new Union <int, string, Colors, Animals>("1234"); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void DifferentT3T4Values_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union <int, string, Colors, Animals>(Colors.Red); var b = new Union <int, string, Colors, Animals>(Animals.Cow); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void SameT4Values_AreEqualAndHaveSameHashCode() { var a = new Union <int, string, Colors, Animals>(Animals.Cat); var b = new Union <int, string, Colors, Animals>(Animals.Cat); IsTrue(a.Equals(b)); IsTrue(a == b); AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void DifferentT2T3Values_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union <int, string, Colors>("xyz"); var b = new Union <int, string, Colors>(Colors.Green); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void UnionEqualsSameUnion() { Union <Item, DataUnit> union1 = new Union <Item, DataUnit> .Case1(new Item(42)); Union <Item, DataUnit> union2 = new Union <Item, DataUnit> .Case1(new Item(42)); Assert.True(union1.Equals(union2)); Assert.True(union2.Equals(union1)); Assert.True(union1 == union2); Assert.True(union2 == union1); }
public void UnionIsNotEqualToStructurallyInequalUnion() { Union <Item, DataUnit> union1 = new Union <Item, DataUnit> .Case1(new Item(42)); Union <Item, DataUnit> union2 = new Union <Item, DataUnit> .Case2(new DataUnit(42)); Assert.False(union1.Equals(union2)); Assert.False(union2.Equals(union1)); Assert.True(union1 != union2); Assert.True(union2 != union1); }
public void DifferentT3T4Values_AreNotEqualAndHaveDifferentHashCodes() { var a = new Union<int, string, Colors, Animals>(Colors.Red); var b = new Union<int, string, Colors, Animals>(Animals.Cow); IsFalse(a.Equals(b)); IsTrue(a != b); AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void UnionEqualsItself() { Union <Item, DataUnit> union = new Union <Item, DataUnit> .Case1(new Item(42)); Assert.True(union.Equals(union)); }
public void UnionEqualsItself() { Union<Item, DataUnit> union = new Union<Item, DataUnit>.Case1(new Item(42)); Assert.True(union.Equals(union)); }
public void ComparingT4ValueWithNull_ResultsInNotEqual() { var a = new Union<int, string, Colors, Animals>(Animals.Dog); IsFalse(a.Equals(null)); IsTrue(a != null); IsTrue(null != a); }