public async Task GetConversationsById_ReturnsObjectResult()
        {
            // Arrange
            var conversation = GenerateFake.Conversation();

            _mockRepo.Setup(repo => repo.GetConversationById(conversation.Id))
            .ReturnsAsync(conversation);

            // Act
            var response = await _conversationController.GetConversationById(1);

            // Assert
            Assert.IsAssignableFrom <ObjectResult>(response);
        }
        public async void GetConversations_ConversationsAmount_ReturnsCorrectAmountOfConversations(int expectedAmountConversations)
        {
            //Arrange
            IList<Conversation> conversations = new List<Conversation>();
            for (int i = 0; i < expectedAmountConversations; i++)
            {
                conversations.Add(GenerateFake.Conversation());
            }
            _mockContext.Setup(x => x.Conversations).ReturnsDbSet(conversations);

            //Act
            var conversationsFromRepo = await _mockRepo.GetConversations();

            //Assert
            Assert.Equal(expectedAmountConversations, conversationsFromRepo.Count());
        }
        public async Task GetConversations_ReturnOk()
        {
            //Arrange
            IList <Conversation> conversations = new List <Conversation> {
                GenerateFake.Conversation(),
                                 GenerateFake.Conversation(),
                                 GenerateFake.Conversation()
            };

            _mockRepo.Setup(repo => repo.GetConversations()).ReturnsAsync(conversations);

            //Act
            var response = await _conversationController.GetConversations();

            //Assert
            Assert.IsAssignableFrom <OkObjectResult>(response);
        }
        public async void GetConversationById_ConversationNotExists_ReturnsNull(int nonExistantId)
        {
            // Arrange
            IList<Conversation> conversations = new List<Conversation> {
                    new Conversation() {
                       Id = 1000,
                       ConversationName = "This should work."
                    },
                    GenerateFake.Conversation(),
                    GenerateFake.Conversation()
            };
            _mockContext.Setup(x => x.Conversations).ReturnsDbSet(conversations);

            // Act
            var conversation = await _mockRepo.GetConversationById(nonExistantId);

            // Assert
            Assert.Null(conversation);
        }
        public async void GetConversationById_ConversationExists_ReturnsCorrectConversationId(int expectedId)
        {
            // Arrange
            IList<Conversation> conversations = new List<Conversation> {
                    new Conversation() {
                       Id = expectedId,
                       ConversationName = "This should work."
                    },
                    GenerateFake.Conversation(),
                    GenerateFake.Conversation()
            };
            _mockContext.Setup(x => x.Conversations).ReturnsDbSet(conversations);

            // Act
            var conversation = await _mockRepo.GetConversationById(expectedId);

            // Assert
            Assert.Equal(expectedId, conversation.Id);
        }