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]);
            }
        }
示例#2
0
        // GET: PositionLevel
        public ActionResult Index()
        {
            var listOfPositionLevelServices = _positionLevelService.GetAll();

            return(View(listOfPositionLevelServices));
        }
示例#3
0
 public ActionResult Index()
 {
     return(View(_service.GetAll()));
 }