public void ComponentTest_Return_GetAll_View() { var mock = new Mock <IFileManager>(); var componentService = new ComponentController(mock.Object); var test = componentService.GetAllComponent(); Assert.IsType <List <StoredFile> >(test); }
public void ComponentTest_Return_ViewResult_List_Of_Components() { var mock = new Mock <IFileManager>(); mock.Setup(repo => repo.GetAll()).Returns(GetTestComponent()); var componentService = new ComponentController(mock.Object); var result = componentService.GetAllComponent(); var view = Assert.IsType <List <StoredFile> >(result); var model = Assert.IsAssignableFrom <IEnumerable <StoredFile> >(view); Assert.Equal(GetTestComponent().Count, model.Count()); }