public void ObjectsWithDifferentValueNotEqual(string obj1Value, string obj2Value) { var obj1 = new Vigesimal(obj1Value); var obj2 = new Vigesimal(obj2Value); Assert.True(obj1 != obj2); }
public void NotEqualToObjectOfDifferentType() { var obj1 = new Vigesimal(854); var obj2 = new NotAVigesimal(); Assert.False(obj1.Equals(obj2)); }
public void ObjectsWithSameValueShouldBeEqual(string vigesimalValue, int intValue) { var obj1 = new Vigesimal(vigesimalValue); var obj2 = new Vigesimal(vigesimalValue); //Check they are equal (they should be). Assert.Equal(intValue, obj1.IntValue); Assert.Equal(intValue, obj2.IntValue); //Make sure equality operator agrees in both directions. Assert.True(obj1 == obj2); Assert.True(obj2 == obj1); }
public void ConstructFromInt() { var x = new Vigesimal(IntValue); }
public void HashcodeMatchesIntValueHashcode() { var obj = new Vigesimal(854); Assert.Equal(obj.IntValue, obj.GetHashCode()); }
public void NotEqualToNull() { var obj1 = new Vigesimal(854); Assert.False(obj1.Equals(null)); }
public void ConstructFromString() { var x = new Vigesimal(StringValue); }
public void HasCorrectValueWhenConstructedFromInt(string vigesimalValue, int intValue) { var result = new Vigesimal(intValue); Assert.Equal(vigesimalValue, result.Value); }
public void TestToStringIsCorrect() { var result = new Vigesimal("22E"); Assert.Equal("22E", result.ToString()); }