public void Get_Rules_NoRecords_Test() { _mockRuleOperations.Setup(x => x.GetRules()).Returns(new List <Rule>()); IActionResult result = _RuleController.GetRules(11); Assert.True(result.GetType() == typeof(JsonResult)); Assert.NotEmpty(((JsonResult)result).Value.ToString()); Assert.True((result as JsonResult).Value.ToString() == "No Rules found"); }