public void Test_WeekNumber_ClashesWith_1()
        {
            var input1 = new WeekNumber(new List <int> {
                1, 2, 3, 4, 5
            });
            var input2 = new WeekNumber(new List <int> {
                5, 6, 7, 8, 9
            });

            Assert.True(input1.IntersectWith(input2));
        }
        public void Test_WeekNumber_ClashesWith_3()
        {
            var input1 = new WeekNumber(new List <int> {
                6, 8
            });
            var input2 = new WeekNumber(new List <int> {
                4, 3
            });

            Assert.False(input1.IntersectWith(input2));
        }
        public void Test_WeekNumber_ClashesWith_4()
        {
            var input1 = new WeekNumber(new List <int> {
                1, 3, 7, 9, 11, 13
            });
            var input2 = new WeekNumber(new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
            });

            Assert.True(input1.IntersectWith(input2));
        }
        public void Test_WeekNumber_ClashesWith_2()
        {
            var input1 = new WeekNumber(new List <int> {
                1, 3, 5, 7, 9
            });
            var input2 = new WeekNumber(new List <int> {
                2, 4, 6, 8, 10
            });

            Console.WriteLine(Convert.ToString(input1._weekNumberInBinary, 2));
            Console.WriteLine(Convert.ToString(input2._weekNumberInBinary, 2));
            Assert.False(input1.IntersectWith(input2));
        }
Example #5
0
 public bool IntersectWith(Slot other)
 {
     if (Code == other.Code && Type == other.Type && Number != other.Number)
     {
         return(true);
     }
     if (!Day.Equals(other.Day))
     {
         return(false);
     }
     if (!TimePeriod.IntersectWith(other.TimePeriod))
     {
         return(false);
     }
     return(WeekNumber.IntersectWith(other.WeekNumber));
 }