public async Task UpdateBestelStatus_ShouldSendUpdateBestelStatusCommand()
        {
            var factuurnummer = 10;
            var status        = new UpdateBestelStatus {
                Status = BestelStatus.Afgerond
            };

            var receiver = _nijnContext.CreateCommandReceiver(NameConstants.BestelServiceUpdateBestelStatusCommandQueue);

            receiver.DeclareCommandQueue();
            receiver.StartReceivingCommands(request => new ResponseCommandMessage("10", "Long", request.CorrelationId));

            var result = await _target.UpdateBestelStatus(factuurnummer, status);

            var queue = _nijnContext.CommandBus.Queues[NameConstants.BestelServiceUpdateBestelStatusCommandQueue];

            var okResult = result as OkResult;

            Assert.AreEqual(200, okResult.StatusCode);
            Assert.AreEqual(1, queue.CalledTimes);
        }
        public async Task UpdateBestelStatus_ShouldReturnStatusCode200()
        {
            // Arrange
            var updateBestelStatus = new UpdateBestelStatus()
            {
                Status = BestelStatus.Goedgekeurd,
            };

            _commandPublisherMock.Setup(publisher => publisher.Publish <long>(It.Is <UpdateBestelStatusCommand>
                                                                                  (x => x.Factuurnummer == 1)))
            .ReturnsAsync(1);

            // Act
            var result = await _target.UpdateBestelStatus(1, updateBestelStatus);

            // Assert
            _commandPublisherMock.VerifyAll();

            var requestResult = result as StatusCodeResult;

            Assert.IsNotNull(requestResult);
            Assert.AreEqual(200, requestResult.StatusCode);
        }