public void GetAll_ShouldCall_Create_From_Repository() { mock.Setup(repository => repository.GetAll()).Returns(new List <CpuMetric>()); var result = controller.GetAll(); mock.Verify(repository => repository.GetAll()); }
public void All_ShouldCall_All_From_Repository() { _mock.Setup(repository => repository.GetAll()).Returns(new List <CpuMetric>()); var result = _controller.GetAll(); _mock.Verify(repository => repository.GetAll(), Times.AtMostOnce()); }
public void GetAll_ShouldCall_GetAll_From_Repository() { // Arrange mockRepository.Setup(repository => repository.GetAll()).Returns(new List <CpuMetric>()); // Act var result = controller.GetAll(); // Assert Assert.NotNull(result); }
public void GetAll_ReturnsOk() { var result = _controller.GetAll(); _ = Assert.IsAssignableFrom <IActionResult>(result); }