Example #1
0
        public void Equals_Check(string testValue1, string testValue2, bool expected)
        {
            var comparer = new StringComparer();
            var result   = comparer.Equals(testValue1, testValue2);

            Assert.Equal(expected, result);
        }
Example #2
0
 public ManufacturerComparer()
 {
     _stringComparer            = new StringComparer();
     _guidComparer              = new NullableStructComparer <Guid>();
     _contactsTypeComparer      = new CollectionTypeComparer <ContactDto, ContactComparer>();
     _bothNullOrNotNullComparer = new BothNullOrNotNullComparer();
 }
Example #3
0
        public void GetHashCode_ZeroCheck(string testValue, bool expected)
        {
            var comparer = new StringComparer();
            var hasCode  = comparer.GetHashCode(testValue);
            var result   = hasCode == 0;

            Assert.Equal(expected, result);
        }
Example #4
0
 public ContactComparer()
 {
     _stringComparer            = new StringComparer();
     _guidComparer              = new NullableStructComparer <Guid>();
     _contactTypeComparer       = new NullableStructComparer <ContactType>();
     _intComparer               = new NullableStructComparer <int>();
     _bothNullOrNotNullComparer = new BothNullOrNotNullComparer();
 }
Example #5
0
 public CarComparer()
 {
     _stringComparer            = new StringComparer();
     _guidComparer              = new NullableStructComparer <Guid>();
     _decimalComparer           = new NullableStructComparer <decimal>();
     _dateTimeComparer          = new NullableStructComparer <DateTime>();
     _manufacturerComparer      = new ManufacturerComparer();
     _bothNullOrNotNullComparer = new BothNullOrNotNullComparer();
     _codesComparer             = new CollectionComparer <string, StringComparer>();
 }
Example #6
0
        public void GetHashCode_Null_Throws()
        {
            var comparer = new StringComparer();

            Assert.Throws <ArgumentNullException>(() => comparer.GetHashCode(null));
        }