Beispiel #1
0
        public void LessThan_Returns_False_When_Distance_Is_Greater()
        {
            var smallest = new AgeDistance(sue, greg);
            var greatest = new AgeDistance(sarah, sue);

            Assert.False(greatest < smallest);
        }
Beispiel #2
0
        public void GreaterThan_Returns_True_When_Distance_Is_Greater()
        {
            var smallest = new AgeDistance(sue, greg);
            var greatest = new AgeDistance(sarah, sue);

            Assert.True(greatest > smallest);
        }
Beispiel #3
0
        public void Person1_Is_Always_Oldest_Person()
        {
            var ageDistance = new AgeDistance(greg, sue);

            Assert.Same(sue, ageDistance.Person1);
            Assert.Same(greg, ageDistance.Person2);
        }
Beispiel #4
0
        public void LessThan_Returns_True_When_Distance_Is_Smaller()
        {
            var smallest = new AgeDistance(sue, greg);
            var greatest = new AgeDistance(sarah, sue);

            Assert.True(smallest < greatest);
        }
Beispiel #5
0
        public void Empty_Distance_Is_Not_Smaller_Than_AnyAgeDistance()
        {
            var ageDistance = new AgeDistance(sue, greg);

            Assert.False(AgeDistance.Empty < ageDistance);
        }
Beispiel #6
0
        public void Distance_Is_Youngest_Minus_Oldest()
        {
            var ageDistance = new AgeDistance(greg, sue);

            Assert.Equal(greg.BirthDate - sue.BirthDate, ageDistance.Distance);
        }
Beispiel #7
0
        public void AnyAgeDistance_Is_Smaller_Than_Empty_Distance()
        {
            var ageDistance = new AgeDistance(sue, greg);

            Assert.True(ageDistance < AgeDistance.Empty);
        }
Beispiel #8
0
        public void Person2_Is_Always_Youngest_Person()
        {
            var ageDistance = new AgeDistance(sue, greg);

            Assert.Same(sue, ageDistance.Person1);
            Assert.Same(greg, ageDistance.Person2);
        }