Exemplo n.º 1
0
        public void AddTime_Time_Less_Then_Previous_Time_Should_Throw_ArgumentException()
        {
            var rule = new DayRule()
                       .AddTime(new TimeSpan(0, 2, 0, 0), 0);

            Assert.Throws <ArgumentException>(() => rule.AddTime(new TimeSpan(0, 1, 0, 0), 0));
        }
Exemplo n.º 2
0
        public void AddTime_Configuration_Is_Ended_Should_Throw_InvalidOperationException()
        {
            var rule = new DayRule()
                       .AddTime(new TimeSpan(0, 1, 0, 0), 0)
                       .EndConfiguration();

            Assert.Throws <InvalidOperationException>(() => rule.AddTime(new TimeSpan(0, 1, 0, 0), 0));
        }
Exemplo n.º 3
0
        public void AddTime_TollFee_Less_Then_0_Should_Throw_ArgumentException()
        {
            var rule = new DayRule();

            Assert.Throws <ArgumentException>(() => rule.AddTime(new TimeSpan(1, 0, 0), -1));
        }
Exemplo n.º 4
0
        public void AddTime_Time_Greater_Then_One_Day_Should_Throw_ArgumentOutOfRangeException()
        {
            var rule = new DayRule();

            Assert.Throws <ArgumentOutOfRangeException>(() => rule.AddTime(new TimeSpan(1, 0, 0, 1), 0));
        }