Exemplo n.º 1
0
        public void ObjectsWithDifferentValueNotEqual(string obj1Value, string obj2Value)
        {
            var obj1 = new Vigesimal(obj1Value);
            var obj2 = new Vigesimal(obj2Value);

            Assert.True(obj1 != obj2);
        }
Exemplo n.º 2
0
        public void NotEqualToObjectOfDifferentType()
        {
            var obj1 = new Vigesimal(854);
            var obj2 = new NotAVigesimal();

            Assert.False(obj1.Equals(obj2));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void ConstructFromInt()
 {
     var x = new Vigesimal(IntValue);
 }
Exemplo n.º 5
0
        public void HashcodeMatchesIntValueHashcode()
        {
            var obj = new Vigesimal(854);

            Assert.Equal(obj.IntValue, obj.GetHashCode());
        }
Exemplo n.º 6
0
        public void NotEqualToNull()
        {
            var obj1 = new Vigesimal(854);

            Assert.False(obj1.Equals(null));
        }
Exemplo n.º 7
0
 public void ConstructFromString()
 {
     var x = new Vigesimal(StringValue);
 }
Exemplo n.º 8
0
        public void HasCorrectValueWhenConstructedFromInt(string vigesimalValue, int intValue)
        {
            var result = new Vigesimal(intValue);

            Assert.Equal(vigesimalValue, result.Value);
        }
Exemplo n.º 9
0
        public void TestToStringIsCorrect()
        {
            var result = new Vigesimal("22E");

            Assert.Equal("22E", result.ToString());
        }