public void ShouldGetDependentCount() { Dictionary <DateTime, int> expected = new Dictionary <DateTime, int>() { { new DateTime(), 3 } }; Mock <IDashboardService> mockService = new Mock <IDashboardService>(); mockService.Setup(s => s.GetDailyDependentCount(It.IsAny <int>())).Returns(expected); DashboardController controller = new DashboardController( mockService.Object); IActionResult actualResult = controller.GetDependentCount(-480); Assert.IsType <JsonResult>(actualResult); Assert.True(((JsonResult)actualResult).Value.IsDeepEqual(expected)); }