Exemplo n.º 1
0
        public void TestEqual()
        {
            var left  = new Integer32(599);
            var right = new Integer32(599);

            Assert.Equal(599.GetHashCode(), left.GetHashCode());
            Assert.Equal(left, right);
            Assert.True((Integer32)null == (Integer32)null);
            Assert.NotEqual(null, right);
            Assert.NotEqual(left, null);
            Assert.True(left.Equals((object)right));
            Assert.True(left.Equals(right));
            Assert.True(left != null);
        }
        public void TestEqual()
        {
            var left = new Integer32(599);
            var right = new Integer32(599);
            Assert.AreEqual(left, right);
// ReSharper disable RedundantCast
// ReSharper disable EqualExpressionComparison
            Assert.IsTrue((Integer32)null == (Integer32)null);
// ReSharper restore EqualExpressionComparison
// ReSharper restore RedundantCast
            Assert.AreNotEqual(null, right);
            Assert.AreNotEqual(left, null);
            Assert.IsTrue(left.Equals(right));
            Assert.IsTrue(left != null);
        }
Exemplo n.º 3
0
        public void TestEqual()
        {
            var left  = new Integer32(599);
            var right = new Integer32(599);

            Assert.Equal(left, right);
// ReSharper disable RedundantCast
// ReSharper disable EqualExpressionComparison
            Assert.True((Integer32)null == (Integer32)null);
// ReSharper restore EqualExpressionComparison
// ReSharper restore RedundantCast
            Assert.NotEqual(null, right);
            Assert.NotEqual(left, null);
            Assert.True(left.Equals(right));
            Assert.True(left != null);
        }