public void Should_Be_Implicitly_Convertible_To_A_String() { // arrange var a1 = new HelperStringEnum("a"); // act var a2 = (string)a1; // assert Assert.That(a2, Is.EqualTo(a1.Value)); }
public void Should_Be_Greater_Than_When_Compared_To_Null() { // arrange var a = new HelperStringEnum("a"); // act int comparisonResult = a.CompareTo(null); // assert Assert.That(comparisonResult, Is.GreaterThan(0)); }
public void Should_Not_Be_Equal_When_Casted_To_Object_And_Tested_With_Null() { object a = new HelperStringEnum("a"); var b = (HelperStringEnum)null; // act bool isEquatable = a.Equals(b); // assert Assert.That(isEquatable, Is.False); }
public void Should_Be_Equal_To_Itself_When_ToStringed() { // arrange var a1 = new HelperStringEnum("a"); // act string a2 = a1.ToString(); // assert Assert.That(a2, Is.EqualTo(a1.Value)); }
public void Should_Be_Greater_When_Compared() { // arrange var a = new HelperStringEnum("a"); var b = new HelperStringEnum("b"); // act int comparisonResult = b.CompareTo(a); // assert Assert.That(comparisonResult, Is.GreaterThan(0)); }
public void Should_Be_Equal_When_Compared() { // arrange var a1 = new HelperStringEnum("a"); var a2 = new HelperStringEnum("a"); // act int comparisonResult = a1.CompareTo(a2); // assert Assert.That(comparisonResult, Is.EqualTo(0)); }
public void Should_Be_Equal_When_Casted_To_Object() { // arrange object a1 = new HelperStringEnum("a"); var a2 = new HelperStringEnum("a"); // act bool isEquatable = a1.Equals(a2); // assert Assert.That(isEquatable, Is.True); }
public void Should_Not_Be_Equal_When_Casted_To_Object() { // arrange object a = new HelperStringEnum("a"); var b = new HelperStringEnum("b"); // act bool isEquatable = a.Equals(b); // assert Assert.That(isEquatable, Is.False); }
public void Should_Be_Less_Than_When_Compared() { // arrange var a = new HelperStringEnum("a"); var b = new HelperStringEnum("b"); // act int comparisonResult = a.CompareTo(b); // assert Assert.That(comparisonResult, Is.LessThan(0)); }
public void Should_Be_Equal_When_Hashed() { // arrange var a1 = new HelperStringEnum("a"); var a2 = new HelperStringEnum("a"); // act int hashCode1 = a1.GetHashCode(); int hashCode2 = a2.GetHashCode(); // assert Assert.That(hashCode1, Is.EqualTo(hashCode2)); }