public void ShouldReturnMessagesInOrderTheyWereAdded() { var mailbox = new MailBox<string>(); mailbox.AddMessage("one"); mailbox.AddMessage("two"); string message; Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("one")); Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("two")); }
public void ShouldReturnMessagesInOrderTheyWereAdded() { var mailbox = new MailBox <string>(); mailbox.AddMessage("one"); mailbox.AddMessage("two"); string message; Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("one")); Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("two")); }
public void ShouldReturnMessageWhenOneAvailable() { var mailbox = new MailBox<string>(); mailbox.AddMessage("hi"); string message; Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("hi")); }
public void ShouldReturnMessageWhenOneAvailable() { var mailbox = new MailBox <string>(); mailbox.AddMessage("hi"); string message; Assert.That(mailbox.TryGetNextMessage(out message)); Assert.That(message, Is.EqualTo("hi")); }