public async Task _BadArgs() { try { await store.LogActivityAsync(null); Assert.Fail("LogActivity Should have thrown on null "); } catch (ArgumentNullException) { } catch { Assert.Fail("LogActivity Should have thrown ArgumentNull exception on null "); } try { await store.GetTranscriptActivitiesAsync(null, null); Assert.Fail("GetConversationActivities Should have thrown on null"); } catch (ArgumentNullException) { } catch { Assert.Fail("DeleteConversation Should have thrown ArgumentNull "); } try { await store.GetTranscriptActivitiesAsync("asdfds", null); Assert.Fail("GetConversationActivities Should have thrown on null"); } catch (ArgumentNullException) { } catch { Assert.Fail("DeleteConversation Should have thrown ArgumentNull "); } try { await store.ListTranscriptsAsync(null); Assert.Fail("ListConversations Should have thrown on null"); } catch (ArgumentNullException) { } catch { Assert.Fail("ListConversations Should have thrown ArgumentNull "); } try { await store.DeleteTranscriptAsync(null, null); Assert.Fail("DeleteConversation Should have thrown on null channelId"); } catch (ArgumentNullException) { } catch { Assert.Fail("DeleteConversation Should have thrown ArgumentNull on channelId"); } try { await store.DeleteTranscriptAsync("test", null); Assert.Fail("DeleteConversation Should have thrown on null conversationId"); } catch (ArgumentNullException) { } catch { Assert.Fail("DeleteConversation Should have thrown ArgumentNull on conversationId"); } }
public async Task ElasticsearchTranscriptStore_DeleteTranscriptsTest() { // Arrange var activity = new Activity(); activity.ChannelId = "TestChannelId"; activity.Conversation = new ConversationAccount(); activity.Conversation.Id = "TestConversationId"; activity.Timestamp = DateTimeOffset.Now; for (int i = 0; i < 50; i++) { // Log activity. await transcriptStore.LogActivityAsync(activity); // Update timestamp. activity.Timestamp = DateTimeOffset.Now.AddSeconds(1); } // Act await transcriptStore.DeleteTranscriptAsync(activity.ChannelId, activity.Conversation.Id); var result = new List <IActivity>(); var pagedResult = new PagedResult <IActivity>(); do { pagedResult = await transcriptStore.GetTranscriptActivitiesAsync(activity.ChannelId, activity.Conversation.Id, pagedResult.ContinuationToken); foreach (var item in pagedResult.Items) { result.Add(item); } }while (pagedResult.ContinuationToken != null); // Assert Assert.AreEqual(0, result.Count); }