public void ShouldConsiderConformingManyPropertiesObjectsEqual() { var first = new ManyProperties(1, 2.0, "dummy", true); var second = new ManyProperties(1, 2.0, "dummy", true); Assert.That(first.Equals(second), Is.True); }
public void ShouldGenerateHashCodeForManyPropertiesObject() { var value = new ManyProperties(10, 5.5, "Hash", true); Assert.That(value.GetHashCode(), Is.EqualTo(HashCode.From(10, 5.5, "Hash", true))); }
public void ShouldGenerateStringForManyPropertiesObject() { var value = new ManyProperties(1, 1.1, "text", true); var text = value.ToString(); Assert.That(text, Is.StringMatching("^.*, .*, .*, .*$")); Assert.That(text, Is.StringContaining("Integer: 1")); Assert.That(text, Is.StringContaining("Value: 1.1")); Assert.That(text, Is.StringContaining("Text: \"text\"")); Assert.That(text, Is.StringContaining("Truth: <True>")); }
public void ShouldConsiderDifferingManyPropertiesObjectsNotEqual(int integer, double value, string text, bool truth) { var first = new ManyProperties(1, 2.0, "dummy", true); var second = new ManyProperties(integer, value, text, truth); Assert.That(first.Equals(second), Is.False); }