예제 #1
0
        public async Task GiveValidTeamId_ShouldRaiseConversations()
        {
            var command = new GetConversationsByTeamIdQuery {
                TeamId = validTeamId
            };
            var result = await _sut.Handle(command, CancellationToken.None);

            result.ShouldNotBeNull();
            result.ShouldBeOfType <List <ConversationModel> >();
            foreach (ConversationModel con in result)
            {
                con.TeamId.ShouldBe(validTeamId.ToString());
                con.Type.ShouldBe("channel");
            }
        }
예제 #2
0
        public async Task Handle_GivenTeamIdHaveTwoConversations_ReturnListConversation()
        {
            var sut = new GetConversationsByTeamIdQueryHandler(_context, _mapper);

            var result = await sut.Handle(new GetConversationsByTeamIdQuery
            {
                TeamId = twoConversation_TeamId
            }
                                          , CancellationToken.None);

            result.Count().ShouldBe(2);
        }