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"));
        }
Beispiel #2
0
        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 ShouldReturnFalseIfNoMessages()
        {
            var mailbox = new MailBox<string>();

            string message;
            Assert.That(mailbox.TryGetNextMessage(out message), Is.False);
        }
Beispiel #4
0
        public void ShouldReturnFalseIfNoMessages()
        {
            var mailbox = new MailBox <string>();

            string message;

            Assert.That(mailbox.TryGetNextMessage(out message), Is.False);
        }
        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"));
        }
Beispiel #6
0
        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"));
        }