public void GetErrorsCount_ReturnOk() { //Arrange var fromTime = DateTimeOffset.Now.AddDays(-4); var toTime = DateTimeOffset.Now; mockRepository.Setup(repository => repository.GetByPeriod(It.IsAny <PeriodArgs>())).Returns(new List <HddMetric>() { new HddMetric() { Time = fromTime.ToUnixTimeSeconds(), Value = 1 } }); //Act var result = controller.GetLeftSpace(fromTime, toTime); //Assert _ = Assert.IsAssignableFrom <IActionResult>(result); }