Ejemplo n.º 1
0
        public void No_Arg_All_Values_Are_Between_Zero_And_MaxValue()
        {
            var timeSpans = new TimeSpan[Assertion.Amount];

            for (var i = 0; i < Assertion.Amount; i++)
            {
                timeSpans[i] = TimeSpanProvider.TimeSpan();
            }

            timeSpans.AssertNotAllValuesAreTheSame();
            Assert.True(
                timeSpans.All(x => x > TimeSpan.Zero && x < TimeSpan.MaxValue),
                "TimeSpans.All(x => x > 0 && x < TimeSpan.MaxValue)"
                );
        }
Ejemplo n.º 2
0
        public void Inclusive_Min_Arg()
        {
            var timeSpans = new TimeSpan[Assertion.Amount];

            var arg = TimeSpan.FromDays(1);

            for (var i = 0; i < Assertion.Amount; i++)
            {
                timeSpans[i] = TimeSpanProvider.TimeSpan(arg, arg);
            }

            Assert.True(
                timeSpans.All(x => x == arg),
                "TimeSpans.All(x => x == arg)"
                );
        }
Ejemplo n.º 3
0
        public void All_Values_Are_Between_Zero_And_Max()
        {
            var timeSpans = new TimeSpan[Assertion.Amount];

            var max = TimeSpan.FromDays(1);

            for (var i = 0; i < Assertion.Amount; i++)
            {
                timeSpans[i] = TimeSpanProvider.TimeSpan(max);
            }

            timeSpans.AssertNotAllValuesAreTheSame();
            Assert.True(
                timeSpans.All(x => x >= TimeSpan.Zero && x < max),
                "TimeSpans.All(x => x > 0 && x < max)"
                );
        }
Ejemplo n.º 4
0
        public void Exclusive_Max_Arg()
        {
            var timeSpans = new TimeSpan[Assertion.Amount];

            var max = TimeSpan.FromDays(1);
            var min = max.Subtract(TimeSpan.FromTicks(1));

            for (var i = 0; i < Assertion.Amount; i++)
            {
                timeSpans[i] = TimeSpanProvider.TimeSpan(min, max);
            }

            Assert.True(
                timeSpans.All(x => x == min),
                "TimeSpans.All(x => x == min)"
                );
        }