public void Get_WhenCalled_ReturnsOkResult() { // Act var okResult = _controller.Get(); // Assert Assert.IsType <OkObjectResult>(okResult.Result); }
public void Test_Does_User_Exist() { var mo = new Mock <IUserCrud>(); mo.Setup(mo => mo.Get()) .Returns(RetrieveUser()); //Create the controller in use var controller = new userController(mo.Object); var retrieved = controller.Get("KimJongUn"); Assert.Collection(retrieved, item => Assert.Contains("KimJongUn", item.UserName)); }