コード例 #1
0
        public void MinOrValue_SameValueAgeAndName_ReturnsSameValue()
        {
            var sameValueComparable = new TestComparable()
            {
                Name = "B",
                Age  = 2
            };

            IGenericValueComparer <TestComparable> stringValueComparer = CreateTestComparableComparer();

            TestComparable returnValue = stringValueComparer.MinOrValue(sameValueComparable);

            Assert.AreEqual(returnValue, sameValueComparable);
        }
コード例 #2
0
        public void MinOrValue_HigerValueAge_ReturnsSameValue()
        {
            var higherValueAge = new TestComparable()
            {
                Name = "B",
                Age  = 3
            };

            IGenericValueComparer <TestComparable> stringValueComparer = CreateTestComparableComparer();

            TestComparable returnValue = stringValueComparer.MinOrValue(higherValueAge);

            Assert.AreEqual(returnValue, higherValueAge);
        }
コード例 #3
0
        public void MinOrValue_LowerValueAge_ReturnsMinTestComparable()
        {
            var lowerValueAgeComparable = new TestComparable()
            {
                Name = "B",
                Age  = 1
            };

            IGenericValueComparer <TestComparable> stringValueComparer = CreateTestComparableComparer();

            TestComparable returnValue = stringValueComparer.MinOrValue(lowerValueAgeComparable);

            Assert.AreEqual(returnValue, MinTestComparableValue);
        }