Exemplo n.º 1
0
        public void GetInstance_WhenCalledWithNegativeIndex_ThrowsException(int index)
        {
            Assume.That(index, Is.LessThan(0));
            var single = new SingleDaySchedule(DateTime.MinValue);

            Assert.That(() => single.GetInstance(index), Throws.InstanceOf <ArgumentOutOfRangeException>());
        }
Exemplo n.º 2
0
        public void GetInstance_WhenCalledWithZeroIndex_DoesNotReturnNull()
        {
            var single = new SingleDaySchedule(DateTime.MinValue);

            var instance = single.GetInstance(0);

            Assert.That(instance, Is.Not.Null);
        }
Exemplo n.º 3
0
        public void GetInstance_WhenCalledWithZeroIndex_MatchesFirstYieldedInstance()
        {
            var single = new SingleDaySchedule(DateTime.MinValue);

            var first = single.YieldAllInstances().First();
            var zero  = single.GetInstance(0);

            Assert.That(zero, Is.EqualTo(first));
        }
Exemplo n.º 4
0
        public void GetInstance_WhenCalledWithPositiveNonZeroIndex_ReturnsNull(int index)
        {
            Assume.That(index, Is.GreaterThan(0));
            var single = new SingleDaySchedule(DateTime.MinValue);

            var instance = single.GetInstance(index);

            Assert.That(instance, Is.Null);
        }