コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 private void SetupPostCreatePositionSuccess()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.SavePosition(_validPosition)).Returns(_validPosition);
     _positionsController = new PositionsController(null, service.Object);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 private void SetupPostCreatePositionFailure()
 {
     _positionsController = new PositionsController(null, null);
 }
コード例 #6
0
 private void SetupGetPositions()
 {
     var service = new Mock<IPositionService>();
     service.Setup(x => x.GetPositions()).Returns(new List<Position>());
     _positionsController = new PositionsController(null, service.Object);
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 private void SetupGetCreatePosition()
 {
     _positionsController = new PositionsController(null, null);
 }
コード例 #9
0
 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);
 }