private void SetupPostCreateUserPositionSuccess()
 {
     var accountService = new Mock<IAccountService>();
     var positionService = new Mock<IPositionService>();
     accountService.Setup(x => x.FindUsers(It.IsAny<UsersSearchCriteria>())).Returns(new List<User>());
     positionService.Setup(x => x.SaveUserPositions(It.IsAny<IEnumerable<UserPosition>>())).Returns(new List<UserPosition> { new UserPosition() });
     positionService.Setup(x => x.GetPosition(It.IsAny<long>())).Returns(new Position {Name = "", Id = 0});
     _positionsController = new PositionsController(new BaseServiceCollection(accountService.Object, null, null), positionService.Object);
 }
 private void SetupReadPosition()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.FindUserPositions(It.IsAny<UserPositionsSearchCriteria>())).Returns(
         new List<UserPosition> {new UserPosition { User = new User(), Position = new Position() }});
     _positionsController = new PositionsController(null, service.Object);
 }
 private void SetupPostCreatePositionSuccess()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.SavePosition(_validPosition)).Returns(_validPosition);
     _positionsController = new PositionsController(null, service.Object);
 }
 private void SetupPostCreateUserPositionFailure()
 {
     var positionService = new Mock<IPositionService>();
     positionService.Setup(x => x.GetPosition(It.IsAny<long>())).Returns(new Position {Name = "", Id = 0});
     _positionsController = new PositionsController(null, positionService.Object);
 }
 private void SetupPostCreatePositionFailure()
 {
     _positionsController = new PositionsController(null, null);
 }
 private void SetupGetPositions()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.GetPositions()).Returns(new List<Position>());
     _positionsController = new PositionsController(null, service.Object);
 }
 private void SetupGetCreateUserPosition()
 {
     var position = new Mock<Position>();
     position.Setup(x => x.Id).Returns(1);
     position.Setup(x => x.Name).Returns("TestPosition");
     var service = new Mock<IPositionService>();
     service.Setup(x => x.GetPosition(It.IsAny<long>())).Returns(position.Object);
     _positionsController = new PositionsController(null, service.Object);
 }
 private void SetupGetCreatePosition()
 {
     _positionsController = new PositionsController(null, null);
 }
 private void SetupDeleteUserPosition()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.GetUserPosition(It.IsAny<long>())).Returns(new UserPosition());
     service.Setup(x => x.DeleteUserPosition(It.IsAny<UserPosition>()));
     _positionsController = new PositionsController(null, service.Object);
 }