public void Should_Return_False_On_Future_Dates(DateTime dateTime)
        {
            Clock.Adjust(new DateTime(2010, 10, 10, 10, 00, 00));

            var result = dateTime.IsPast(Clock);

            result.Should().BeFalse();
        }
Esempio n. 2
0
        public void Should_Return_True_On_Future_Dates(DateTime dateTime)
        {
            Clock.Adjust(new DateTime(2010, 01, 01, 10, 00, 00));

            var result = dateTime.IsInFuture(Clock);

            result.Should().BeTrue();
        }
        public void Should_Return_True_On_Today_Dates(DateTime dateTime)
        {
            Clock.Adjust(new DateTime(2010, 10, 10, 10, 00, 00));

            var result = dateTime.IsToday(Clock);

            result.Should().BeTrue();
        }
        public void Should_Be_Able_To_Count_Past_Hours_Between_NowDate_And_Another_Date(DateTime birthDate, int expected)
        {
            Clock.Adjust(new DateTime(2010, 01, 01, 10, 00, 00));

            var result = birthDate.PastHoursFromNow(Clock);

            result.Should().Be(expected);
        }
Esempio n. 5
0
        public void Should_Throw_On_Future_Dates(DateTime birthDate)
        {
            Clock.Adjust(new DateTime(2010, 01, 01));

            Action calculateAge = () => birthDate.CalculateAge(Clock);

            calculateAge.Should().Throw <InvalidBirthDateException>();
        }
Esempio n. 6
0
        public void Should_Return_Age_With_Counting_Leap_Years(DateTime birthDate, int expectedAge)
        {
            Clock.Adjust(new DateTime(2010, 01, 01));

            var age = birthDate.CalculateAge(Clock);

            age.Should().Be(expectedAge);
        }