Пример #1
0
        public void SetsPunchPointsAsReadOnlyDictionary()
        {
            IList<int> point1 = new[] { 1, 0, 3 };
            IList<int> point2 = new[] { 1, 1, 4 };
            IList<int> point3 = new[] { 1, 2, 0 };
            IEnumerable<IList<int>> points = new List<IList<int>> { point1, point2, point3 };

            var punchCard = new PunchCard(points);

            AssertEx.IsReadOnlyCollection<PunchCardPoint>(punchCard.PunchPoints);
        }
Пример #2
0
        public void CanQueryCommitsForDayAndHour()
        {
            IList<int> point1 = new[] { 1, 0, 3 };
            IList<int> point2 = new[] { 1, 1, 4 };
            IList<int> point3 = new[] { 1, 2, 0 };
            IEnumerable<IList<int>> points = new List<IList<int>> { point1,point2,point3 };

            var punchCard = new PunchCard(points);

            var commitsAtMondayAt12Am = punchCard.GetCommitCountFor(DayOfWeek.Monday, 0);
            var commitsAtMondayAt1Am = punchCard.GetCommitCountFor(DayOfWeek.Monday, 1);
            var commitsAtMondayAt2Am = punchCard.GetCommitCountFor(DayOfWeek.Monday, 2);
            var commitsAtTuesdayAt2Am = punchCard.GetCommitCountFor(DayOfWeek.Tuesday, 2);

            Assert.Equal(3,commitsAtMondayAt12Am);
            Assert.Equal(4, commitsAtMondayAt1Am);
            Assert.Equal(0, commitsAtMondayAt2Am);
            Assert.Equal(0, commitsAtTuesdayAt2Am);
        }