public void GetAll() { IEnumerable <PositionLevelDto> positionLevels = new PositionLevelDto[] { new PositionLevelDto() { PositionLevelDtoId = 1 }, new PositionLevelDto() { PositionLevelDtoId = 2 } }; var expectedIds = new[] { 1, 2 }; A.CallTo(() => _positionLevel.GetAll <PositionLevelDto>()).Returns(positionLevels); var expectedPositionLevels = _positionLevelService.GetAll().ToList(); Assert.Equal(expectedIds.Length, expectedPositionLevels.Count); for (var i = 0; i < expectedIds.Length; i++) { Assert.Equal(expectedPositionLevels[i].PositionLevelDtoId, expectedIds[i]); } }
// GET: PositionLevel public ActionResult Index() { var listOfPositionLevelServices = _positionLevelService.GetAll(); return(View(listOfPositionLevelServices)); }
public ActionResult Index() { return(View(_service.GetAll())); }