public void Index_Default_Allpositions() { // Arrange - create the controller PositionController target = new PositionController(mock.Object); // Act - call the action method IEnumerable <Position> result = (IEnumerable <Position>)target.Index().Model; List <Position> positionView = result.ToList <Position>(); // Assert - check the result CollectionAssert.AreEqual(mock.Object.Positions, positionView); }
public void IndexView_True() { // Arrange - create the controller PositionController target = new PositionController(mock.Object); // Act - call the action method ViewResult result = target.Index(); // Assert - check the result Assert.AreEqual("", result.ViewName); }