コード例 #1
0
        public static async Task <QueryRetrieveMasterInformationByUser_Output> TestQueryRetrieveRecentChats()
        {
            IMGTExchangeClient clientMGT = new MGTExchangeClient();
            string             _url      = "http://10.18.24.67:8082/";
            string             _token    = "token";

            // This is to be used as master List, to show recent chats, and recent message of each chat (seen or unseen).
            // After that the user can click in an specific chat to check more information
            QueryRetrieveMasterInformationByUser_Input input = new QueryRetrieveMasterInformationByUser_Input
            {
                UserApp = new userApp {
                    userAppId = "10d3ed1e-ae7d-4d0c-80e0-aa360d76025b"
                },
                chatsRecentTake          = 5,
                commentsSeenTake         = 0,
                commentsUnseenTake       = 0,
                commentsNewestTake       = 1,
                commentsBeforeUnseenTake = 0,
                findSpecificChatId       = 0, // 0 means no, any number means ChatId
                url   = _url,
                token = _token
            };

            QueryRetrieveMasterInformationByUser_Output output = await clientMGT.QueryRetrieveRecentChats(input : input);

            return(output);
        }
コード例 #2
0
        public static async Task <QueryRetrieveMasterInformationByUser_Output> TestQueryRetrieveChatComments()
        {
            IMGTExchangeClient clientMGT = new MGTExchangeClient();
            string             _url      = "http://10.18.24.67:8082/";
            string             _token    = "token";

            // This is to be used when a user clicks any Chat from the master chats list
            // The app must show unseen comments if any, if none, wold show newest comments
            // Logic in FrontEnd must be
            // IF commentsUnseen is null THEN show only commentsNewest
            // ELSE show commentsUnseen   (Note: In the transaction the beforeUnsee and Unseen are joined)
            // Pending mark as seen all the commentsUnseen Retrieved, create a variable to decidi if mark as seen or not
            QueryRetrieveMasterInformationByUser_Input input = new QueryRetrieveMasterInformationByUser_Input
            {
                UserApp = new userApp {
                    userAppId = "127b0df2-d732-478e-bf84-0b673c48d145"
                },                                                                            //10d3ed1e-ae7d-4d0c-80e0-aa360d76025b" },
                chatsRecentTake          = 1,
                commentsSeenTake         = 0,
                commentsBeforeUnseenTake = 5,
                commentsUnseenTake       = 10,
                commentsNewestTake       = 10,
                findSpecificChatId       = 2, // 0 means no, any number means ChatId
                url   = _url,
                token = _token
            };

            QueryRetrieveMasterInformationByUser_Output output = await clientMGT.QueryRetrieveRecentChats(input : input);

            return(output);
        }
コード例 #3
0
        public async Task TestQueryRetrieveUnseenCommentsOrNewestByUser()
        {
            // This is to be used when a user clicks any Chat from the master chats list
            // The app must show unseen comments if any, if none, wold show newest comments
            // Logic in FrontEnd must be
            // IF commentsUnseen is null THEN show only commentsNewest
            // ELSE show commentsUnseen   (Note: In the transaction the beforeUnsee and Unseen are joined)
            // Pending mark as seen all the commentsUnseen Retrieved, create a variable to decidi if mark as seen or not
            QueryRetrieveMasterInformationByUser_Input input = new QueryRetrieveMasterInformationByUser_Input
            {
                UserApp = new userApp {
                    userAppId = "127b0df2-d732-478e-bf84-0b673c48d145"
                },                                                                            //10d3ed1e-ae7d-4d0c-80e0-aa360d76025b" },
                chatsRecentTake          = 1,
                commentsSeenTake         = 0,
                commentsBeforeUnseenTake = 5,
                commentsUnseenTake       = 10,
                commentsNewestTake       = 10,
                findSpecificChatId       = 2, // 0 means no, any number means ChatId
                url   = "http://10.18.24.67:8082/",
                token = "token"
            };
            // Bind all the variables needed.
            QueryRetrieveMasterInformationByUser_Output output = await new QueryRetrieveMasterInformationByUser().Execute(input: input);

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ResultConfirmation.resultPassed, Is.True);
            Assert.That(output.commentsNewest.Count, Is.GreaterThan(0));
        }
コード例 #4
0
        public async Task TestQueryRetrieveNewestChatsAndCommentsByUser()
        {
            // This is to be used as master List, to show recent chats, and recent message of each chat (seen or unseen).
            // After that the user can click in an specific chat to check more information
            QueryRetrieveMasterInformationByUser_Input input = new QueryRetrieveMasterInformationByUser_Input
            {
                UserApp = new userApp {
                    userAppId = "10d3ed1e-ae7d-4d0c-80e0-aa360d76025b"
                },
                chatsRecentTake          = 1,
                commentsSeenTake         = 0,
                commentsUnseenTake       = 0,
                commentsNewestTake       = 1,
                commentsBeforeUnseenTake = 0,
                findSpecificChatId       = 0, // 0 means no, any number means ChatId
                url   = "http://10.18.24.67:8082/",
                token = "token"
            };
            // Bind all the variables needed.
            QueryRetrieveMasterInformationByUser_Output output = await new QueryRetrieveMasterInformationByUser().Execute(input: input);

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ResultConfirmation.resultPassed, Is.True);
            Assert.That(output.commentsNewest.Count, Is.GreaterThan(0));
        }
コード例 #5
0
        public async Task ExecuteQueryRetrieveChatComments()
        {
            QueryRetrieveMasterInformationByUser_Output output =
                await MGTQueryExecute.ExecuteQueryRetrieveChatComments(clientMGT : clientMGT, _url : url, _token : token);

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ResultConfirmation.resultPassed, Is.True);
            Assert.That(output.commentsNewest.Count, Is.GreaterThan(0));
        }
コード例 #6
0
        public async Task <QueryRetrieveMasterInformationByUser_Output> QueryRetrieveChatComments(QueryRetrieveMasterInformationByUser_Input input)
        {
            await Task.Delay(1);

            List <comment> _commentsSeen   = _chats.FirstOrDefault().comments.Skip(0).Take(2).ToList();
            List <comment> _commentsUnseen = _chats.FirstOrDefault().comments.Skip(2).Take(2).ToList();
            List <comment> _commentsNewest = _chats.FirstOrDefault().comments.Skip(4).Take(2).ToList();

            QueryRetrieveMasterInformationByUser_Output output = new QueryRetrieveMasterInformationByUser_Output
            {
                ResultConfirmation = new resultConfirmation {
                    resultPassed = true, resultMessage = "OK"
                },
                commentsNewest = _commentsNewest,
                commentsSeen   = _commentsSeen,
                commentsUnseen = _commentsUnseen
            };

            return(output);
        }
コード例 #7
0
        public async Task <QueryRetrieveMasterInformationByUser_Output> QueryRetrieveChatComments(QueryRetrieveMasterInformationByUser_Input input)
        {
            QueryRetrieveMasterInformationByUser_Output output = await new QueryRetrieveMasterInformationByUser().Execute(input: input);

            return(output);
        }