[InlineData(1, -1, false)] //Non-Existent Course public async Task addCoursetoStudentWishlist(int sid, int cid, bool success) { //Arrange var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim("sid", sid.ToString()) })); _controller.ControllerContext = new ControllerContext() { HttpContext = new DefaultHttpContext { User = user } }; var result = await _controller.addCoursetoStudentWishlist(cid); Assert.NotNull(result); if (success) { Assert.IsType <OkObjectResult>(result); } else { Assert.IsType <BadRequestObjectResult>(result); } }