public void TestHashCode()
        {
            var item = new ItemGroup { ID = 1, Name = "1" };
            var item2 = new ItemGroup { ID = 1, Name = "1" };

            Assert.Equal(item.GetHashCode(), item2.GetHashCode());
        }
        public void TestEqualWithSelfAndWithNull()
        {
            var item = new ItemGroup { ID = 1, Name = "1" };
            var item2 = new ItemGroup { ID = 1, Name = "1" };

            Assert.True(item.Equals(item));
            Assert.False(item.Equals(null));
            Assert.True(item.Equals(item2));
        }
Exemplo n.º 3
0
        public void TestEqualWithObject()
        {
            var item = new Item { ID = 1, Name = "1", Description = "2" };
            var item2 = new Item { ID = 1, Name = "1", Description = "2" };
            var itemGroup = new ItemGroup();

            Assert.False(item.Equals((object) null));
            Assert.True(item.Equals((object) item));
            Assert.False(item.Equals((object) itemGroup));
            Assert.True(item.Equals(item2));
        }
Exemplo n.º 4
0
        public void TestEqualWithObject()
        {
            var item = new User { UserName = "******", Password = "******" };
            var item2 = new User { UserName = "******", Password = "******" };
            var itemGroup = new ItemGroup();

            Assert.False(item.Equals((object)null));
            Assert.True(item.Equals((object)item));
            Assert.False(item.Equals((object)itemGroup));
            Assert.True(item.Equals(item2));
        }