public async Task Handle_Should_ReturnErrorWhenUserIsNotFound()
        {
            var command = new LogoutCommand("*****@*****.**");

            _userRepositoryMock.Setup(m => m.Get(It.IsAny <string>()))
            .ReturnsAsync((User)null);

            var result = await _handler.Handle(command, GetCancellationToken());

            result.Should().NotBeNull();
            result.Value.Should().BeFalse();
            result.ErrorMessages.Should().Contain(LogoutCommandHandler.User_Invalid);
        }
        public async Task LogoutSuccess()
        {
            var remoteIpAddress = "192.168.1.1";
            var securityUserId  = Guid.NewGuid();

            _currentUser.SetupGet(c => c.SecurityUserId).Returns(securityUserId);
            _securityUserManager.Setup(m => m.LogoutUserAsync(securityUserId, remoteIpAddress))
            .Returns(Task.CompletedTask);

            await _sut.Handle(new LogoutCommand
            {
                RemoteIpAddress = remoteIpAddress
            }, CancellationToken.None);

            _currentUser.Verify(c => c.SecurityUserId, Times.Once);
            _securityUserManager.Verify(m => m.LogoutUserAsync(securityUserId, remoteIpAddress), Times.Once);
        }