public void PostElevatorDestination_ShouldEnqueueProperCommand() { //Arrange var elevatorId = _fixture.Create <int>(); var destinationId = _fixture.Create <int>(); string resultQueueId = string.Empty; GoToFloorCommand resultAction = null; _elevatorMessagePublisher .Setup(s => s.EnqueueRequest(It.IsAny <string>(), It.IsAny <GoToFloorCommand>())) .Callback <string, GoToFloorCommand>((id, action) => { resultQueueId = id; resultAction = action; }); //Act _sut.EnqueueElevatorDestination(elevatorId, destinationId); //Assert resultQueueId.Should().Be(ElevatorsMessagingHelper.GetQueueId(elevatorId)); resultAction.Should().NotBeNull(); resultAction.ElevatorId.Should().Be(elevatorId); resultAction.DestinationFloorId.Should().Be(destinationId); resultAction.ActionType.Should().Be(ElevatorCommandType.GoToFloor); }
public void Destination([FromRoute] int id, [FromRoute] int floorId) { _elevatorsApiService.EnqueueElevatorDestination(id, floorId); }