コード例 #1
0
        public void GetAverageProcessTimeInMilliseconds_ReturnsAverageOfTimesFromRepository()
        {
            var expectedTimes       = new[] { 5, 18, 2, 25 };
            var expectedAverageTime = (int)expectedTimes.Average();
            var jobs = expectedTimes.Select(t => new Job {
                ElapsedMilliseconds = t
            });

            _mockJobRepository.Setup(j => j.GetAll()).Returns(jobs);

            var actualAverage = _classUnderTest.GetAverageProcessTimeInMilliseconds();

            Assert.That(actualAverage, Is.EqualTo(expectedAverageTime));
        }