コード例 #1
0
        public void AreCloseWithAnyParameterReturnsFalseForNonCloseTimes()
        {
            ClusterParameters target = new ClusterParameters() { MembersTimeDifference = 60, Dates = DatesHandling.WeekendWorkdays };

            Assert.False(target.AreClose(new DateTime(2010, 6, 21, 21, 45, 0), new DateTime(2010, 6, 22, 0, 15, 0)));
            Assert.False(target.AreClose(new DateTime(2010, 6, 22, 1, 45, 0), new DateTime(2010, 6, 22, 0, 15, 0)));
            Assert.False(target.AreClose(new DateTime(2010, 6, 25, 1, 45, 0), new DateTime(2010, 6, 22, 0, 15, 0)));
        }
コード例 #2
0
        public void AreCloseWithAnyParameterReturnsTrueForCloseTimes()
        {
            ClusterParameters target = new ClusterParameters() { MembersTimeDifference = 60, Dates = DatesHandling.Any };

            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 22, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 23, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 24, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 25, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 26, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 27, 1, 15, 0)));

            Assert.True(target.AreClose(new DateTime(2019, 6, 21, 1, 0, 0), new DateTime(2010, 6, 27, 1, 15, 0)));
        }
コード例 #3
0
        public void AreCloseWithDaysParameterReturnsTrueForCloseTimesWithinSameWeekDay()
        {
            ClusterParameters target = new ClusterParameters() { MembersTimeDifference = 60, Dates = DatesHandling.Days };

            Assert.True(target.AreClose(new DateTime(2010, 6, 23, 1, 0, 0), new DateTime(2010, 6, 30, 1, 15, 0)));
        }
コード例 #4
0
        public void AreCloseWithAnyParameterReturnsTrueForCloseTimesAcrossMidnight()
        {
            ClusterParameters target = new ClusterParameters() { MembersTimeDifference = 60, Dates = DatesHandling.Any };

            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 23, 45, 0), new DateTime(2010, 6, 24, 0, 15, 0)));
        }
コード例 #5
0
        public void AreCloseWithWorkdayWeekendParameterReturnsTrueForCloseTimesWithinDayGroups()
        {
            ClusterParameters target = new ClusterParameters() { MembersTimeDifference = 60, Dates = DatesHandling.WeekendWorkdays };

            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 22, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 23, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 24, 1, 15, 0)));
            Assert.True(target.AreClose(new DateTime(2010, 6, 21, 1, 0, 0), new DateTime(2010, 6, 25, 1, 15, 0)));

            Assert.True(target.AreClose(new DateTime(2010, 6, 26, 1, 0, 0), new DateTime(2010, 6, 27, 1, 15, 0)));
        }