Exemple #1
0
            public void YieldAllInstances_WhenCalled_ReturnsASingleInstance()
            {
                var single = new SingleDaySchedule(DateTime.MinValue);

                var count = single.YieldAllInstances().Count();

                Assert.That(count, Is.EqualTo(1));
            }
Exemple #2
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));
            }
Exemple #3
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);
            }
Exemple #4
0
            public void GetInstance_WhenCalledWithZeroIndex_DoesNotReturnNull()
            {
                var single = new SingleDaySchedule(DateTime.MinValue);

                var instance = single.GetInstance(0);

                Assert.That(instance, Is.Not.Null);
            }
Exemple #5
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>());
            }