public void GetHashCodeTest()
        {
            var Comparer = new GenericEqualityComparer <string>();

            Assert.Equal("A".GetHashCode(), Comparer.GetHashCode("A"));
            Assert.Equal("B".GetHashCode(), Comparer.GetHashCode("B"));
        }
		public void GetHashCodeTest()
		{
			var testSamples = new List<UriFormat>
			{
				UriFormat.SafeUnescaped,
				UriFormat.Unescaped,
				UriFormat.UriEscaped
			};

			var comparer = new GenericEqualityComparer<UriFormat>((x, y) => x == y, x => x.GetHashCode());

			for (var index = 0; index < testSamples.Count; index++)
			{
				Assert.AreEqual(testSamples[index].GetHashCode(), comparer.GetHashCode(testSamples[index]));
			}
		}
            public void ShouldReturnSameHashCodeWhenComparingOnProperty()
            {
                // Arrange
                string objectName  = "Hello, World!";
                int    objectCount = 10;

                var obj = new TestObject {
                    Name = objectName, Count = objectCount
                };

                var comparer = new GenericEqualityComparer <TestObject>(o => o.Name);

                // Act
                int hashCode = comparer.GetHashCode(obj);

                // Assert
                hashCode.ShouldBe(obj.Name.GetHashCode());
            }
        public void GetHashCodeForValidObjectReturnsObjectHashCode()
        {
            var sut = new GenericEqualityComparer<Model>();
            var model = new Model();

            Assert.Equal(model.GetHashCode(), sut.GetHashCode(model));
        }
        public void GetHashCodeForNullObjectReturnsZero()
        {
            var sut = new GenericEqualityComparer<Model>();

            Assert.Equal(0, sut.GetHashCode(null));
        }