﻿using System;
using Xunit;

namespace NetChris.Scheduling.Tests.Temporal
{
    public class WeekdayExpressionTests
    {
        [Fact]
        public void TestIncludes()
        {
            // Arrange
            var expression = new Weekday();

            // ReSharper disable InconsistentNaming
            var dec21_2009 = new DateTime(2009, 12, 21); // Monday
            var dec22_2009 = new DateTime(2009, 12, 22); // Tuesday
            var dec23_2009 = new DateTime(2009, 12, 23); // Wednesday
            var dec24_2009 = new DateTime(2009, 12, 24); // Thursday
            var dec25_2009 = new DateTime(2009, 12, 25); // Friday
            var dec26_2009 = new DateTime(2009, 12, 26); // Saturday
            var dec27_2009 = new DateTime(2009, 12, 27); // Sunday
            var dec28_2009 = new DateTime(2009, 12, 28); // Monday
            // ReSharper restore InconsistentNaming

            // Assert
            Assert.True(expression.Includes(dec21_2009));
            Assert.True(expression.Includes(dec22_2009));
            Assert.True(expression.Includes(dec23_2009));
            Assert.True(expression.Includes(dec24_2009));
            Assert.True(expression.Includes(dec25_2009));
            Assert.False(expression.Includes(dec26_2009));
            Assert.False(expression.Includes(dec27_2009));
            Assert.True(expression.Includes(dec28_2009));
        }
    }
}
