예제 #1
0
            private void WhenBothIntervalsHaveTheSameStartDateButDifferentStartIncludedValue_ThenReturnsDifferentThanZero(bool startIncludedIntervalA, bool startIncludedIntervalB, int expectedResult)
            {
                //arrange
                DateTime now = _randomHelper.GetDateTime();

                var intervalA = _randomHelper.GetInterval(now, null, startIncludedIntervalA);
                var intervalB = _randomHelper.GetInterval(now, null, startIncludedIntervalB);

                var sut = new IntervalStartComparer();

                //act
                int result = sut.Compare(intervalA, intervalB);

                //assert
                result.Should().Be(expectedResult);
            }
예제 #2
0
            private void WhenFirstIntervalStartDateIsLaterThanSecondIntervalStartDate_ThenReturnsOne()
            {
                //arrange
                DateTime now = _randomHelper.GetDateTime();

                var intervalA = _randomHelper.GetInterval(now);
                var intervalB = _randomHelper.GetInterval(now.AddTicks(-1));

                var sut = new IntervalStartComparer();

                //act
                int result = sut.Compare(intervalA, intervalB);

                //assert
                result.Should().Be(1);
            }
예제 #3
0
            private void WhenBothIntervalsHaveTheSameStartDateAndSameStartIncludedValue_ThenReturnsZero(bool startIncludedIntervalA, bool startIncludedIntervalB)
            {
                //arrange
                DateTime now = _randomHelper.GetDateTime();

                var intervalA = _randomHelper.GetInterval(now, null, startIncludedIntervalA);
                var intervalB = _randomHelper.GetInterval(now, null, startIncludedIntervalB);

                var sut = new IntervalStartComparer();

                //act
                int result = sut.Compare(intervalA, intervalB);

                //assert
                result.Should().Be(0, "start dates are the same");
            }