public void ByPeriod_ShouldCall_ByPeriod_From_Repository() { _mock.Setup(repository => repository.GetByTimePeriod(It.IsAny <TimePeriod>())).Returns(new List <HddMetric>()); var result = _controller.GetMetricsHddByTimePeriod(new TimePeriod { From = DateTimeOffset.FromUnixTimeSeconds(1620801171), To = DateTimeOffset.FromUnixTimeSeconds(1620801172) }); _mock.Verify(repository => repository.GetByTimePeriod(It.IsAny <TimePeriod>()), Times.AtMostOnce()); }