public async Task Handle_GivenValidConversationId_LoginUserIsNotCreaterAndNotLeader_ThrowsNotOwnedException()
        {
            // Login user is member but is not creator and is not assignee
            _sut = SetLoginUser(memberId);

            var command = new DeleteChannelConversationCommand {
                ConversationId = leaderChannelId.ToString()
            };

            await Assert.ThrowsAsync <NotOwnedException>(() => _sut.Handle(command, CancellationToken.None));
        }
        public async Task Handle_GivenValidConversationId_TeamIdNotExist_ThrowsNotFoundException()
        {
            // Login user is creator
            _sut = SetLoginUser(leaderId);

            var command = new DeleteChannelConversationCommand {
                ConversationId = teamNotExistConversationId.ToString()
            };

            await Assert.ThrowsAsync <NotFoundException>(() => _sut.Handle(command, CancellationToken.None));
        }
        public async Task Handle_GivenValidConversationIdAndValidTeamId_LoginUserIsLeader_DeletesConversation()
        {
            // Login user is leader
            _sut = SetLoginUser(leaderId);

            var command = new DeleteChannelConversationCommand {
                ConversationId = memberChannelId.ToString()
            };

            await _sut.Handle(command, CancellationToken.None);

            var channel = await _context.Conversations.FindAsync(memberChannelId);

            // find all message chat
            var messageChats = await new GetMessageChatsQueryHandler(_context, _mapper)
                               .Handle(new GetMessageChatsQuery {
                ConversationId = memberChannelId
            }, CancellationToken.None);

            Assert.Null(channel);
            messageChats.Count().ShouldBe(0);
        }