public void KeySelectorComparerReturnsZeroWhenFirstItemIsNullAndSecondItemIsNull()
        {
            var comparer = new KeySelectorComparer <KeySelectorTestItem, int>(i => i.Id);

            KeySelectorTestItem first  = null;
            KeySelectorTestItem second = null;

            var result = comparer.Compare(first, second);

            Assert.AreEqual(0, result);
        }
        public void KeySelectorComparerRetunsNegativeOneWhenFirstItemIsNullAndSecondItemIsNot()
        {
            var comparer = new KeySelectorComparer <KeySelectorTestItem, int>(i => i.Id);

            KeySelectorTestItem first  = null;
            KeySelectorTestItem second = new KeySelectorTestItem {
                Id = 1
            };

            var result = comparer.Compare(first, second);

            Assert.AreEqual(-1, result);
        }
        public void KeySelectorComparerReturnsZeroWhenFirstKeyIsEqualToSecondKey()
        {
            var comparer = new KeySelectorComparer <KeySelectorTestItem, int>(i => i.Id);

            var first = new KeySelectorTestItem {
                Id = 1
            };
            var second = new KeySelectorTestItem {
                Id = 1
            };

            var result = comparer.Compare(first, second);

            Assert.AreEqual(0, result);
        }
        public void KeySelectorComparerReturnsNegativeOneWhenFirstKeyIsLessThanSecondKey()
        {
            var comparer = new KeySelectorComparer <KeySelectorTestItem, int>(i => i.Id);

            var first = new KeySelectorTestItem {
                Id = 1
            };
            var second = new KeySelectorTestItem {
                Id = 2
            };

            var result = comparer.Compare(first, second);

            Assert.AreEqual(-1, result);
        }