Beispiel #1
0
        public async Task AddListConversations()
        {
            string userA = RandomString();
            string userB = RandomString();
            string userC = RandomString();

            var dateTime = DateTime.UtcNow;

            var conversations = new[]
            {
                new Conversation(RandomString(), new [] { userA, userB }, dateTime.AddSeconds(1)),
                new Conversation(RandomString(), new [] { userA, userC }, dateTime.AddSeconds(2)),
                new Conversation(RandomString(), new [] { userB, userA }, dateTime.AddSeconds(3)),
            };

            foreach (Conversation conversation in conversations)
            {
                await store.AddConversation(conversation);
            }

            var userBConversations = (await store.ListConversations(userB, "", "", 50)).Conversations.ToList();

            Assert.AreEqual(2, userBConversations.Count());
            Assert.AreEqual(conversations[2], userBConversations[0]);
            Assert.AreEqual(conversations[0], userBConversations[1]);
        }
 public async Task ListConversations_InvalidUsername(string username)
 {
     await store.ListConversations(username, "", "", 50);
 }