public void Service_ClearMessages_EmptyInbox_RespondsFailure() { var service = GetService(); var request = new ClearMessagesRequest() { Inbox = "Bob" }; var response = MakeRequest <ErrorResponse>(service, request); Assert.IsFalse(response.Success); Assert.AreEqual(ErrorMessages.ClearMessagesNoInbox, response.Message, "The message returned was not ErrorMessages.ClearMessagesNoInbox"); }
public void Service_ClearMessages_PopulatedInbox_RespondsWithOk_ClearsMessages() { var service = GetService(new Dictionary <string, IList <string> > { { "Bob", new [] { FirstMessage, SecondMessage }.ToList() } }); var request = new ClearMessagesRequest() { Inbox = "Bob" }; var response = MakeRequest <OkResponse>(service, request); Assert.IsFalse(service.MessageStore.ContainsKey("Bob"), "Bob's mailbox was not removed. .Clear() on the inbox is not enough, it should be removed entirely."); }