예제 #1
0
        public void WhenContainsIsCalledWithAValueEqualToUpperLimt_ThenTrueShouldBeReturned()
        {
            int lowerLimit = 5;
            int upperLimit = 10;

            var classUnderTest = new ClosedInterval <int>(lowerLimitPoint: lowerLimit, upperLimitPoint: upperLimit);

            Assert.IsTrue(classUnderTest.Contains(upperLimit));
        }
예제 #2
0
        public void WhenContainsIsCalledWithAValueEqualToUpperLimt_ThenTrueShouldBeReturned()
        {
            int lowerLimit = 5;
            int upperLimit = 10;

            var classUnderTest = new ClosedInterval<int>(lowerLimitPoint: lowerLimit, upperLimitPoint: upperLimit);

            Assert.IsTrue(classUnderTest.Contains(upperLimit));
        }
예제 #3
0
        public void WhenContainsIsCalledWithAllPointsBetweenLimits_ThenTrueShouldBeReturned()
        {
            var lowerLimit = 0;
            var upperLimit = 10;

            var classUnderTest = new ClosedInterval <int>(lowerLimitPoint: lowerLimit, upperLimitPoint: upperLimit);

            foreach (int candidatePoint in System.Linq.Enumerable.Range(lowerLimit, (upperLimit - lowerLimit) + 1))
            {
                if (!classUnderTest.Contains(candidatePoint))
                {
                    Assert.Fail(System.String.Format("Point: {0} should be contained in interval.", candidatePoint));
                }
            }
        }
예제 #4
0
        public void WhenContainsIsCalledWithAllPointsBetweenLimits_ThenTrueShouldBeReturned()
        {
            var lowerLimit = 0;
            var upperLimit = 10;

            var classUnderTest = new ClosedInterval<int>(lowerLimitPoint: lowerLimit, upperLimitPoint: upperLimit);

            foreach (int candidatePoint in System.Linq.Enumerable.Range(lowerLimit, (upperLimit - lowerLimit) + 1))
            {
                if (!classUnderTest.Contains(candidatePoint))
                {
                    Assert.Fail(System.String.Format("Point: {0} should be contained in interval.", candidatePoint));
                }
            }
        }
예제 #5
0
파일: Report.cs 프로젝트: Mirandatz/Bentham
 private bool PersonIsWithinTargetAttendanceRate(IPerson person, ClosedInterval<float> targetAttendanceRate)
 {
     var personAttendanceRate = CalculatePersonAttendanceRate(person);
     return targetAttendanceRate.Contains(personAttendanceRate);
 }