public void GetByTimePeriod_ShouldCall_GetByTimePeriod_From_Repository() { _repositoryMock.Setup(repository => repository.GetByTimePeriod(It.IsAny <DateTimeOffset>(), It.IsAny <DateTimeOffset>())) .Returns(new List <CpuMetric>()); _controller.GetByTimePeriod(DateTimeOffset.Now, DateTimeOffset.Now); _repositoryMock.Verify(repository => repository.GetByTimePeriod(It.IsAny <DateTimeOffset>(), It.IsAny <DateTimeOffset>()), Times.AtMostOnce()); }