public void Dump_GetsNullParameter_ThrowsException()
        {
            var target = new MessageContext();

            target.Add("Fact");

            Action act = () => target.Dump(null);

            act.Should().Throw <ArgumentNullException>();
        }
        public void Dump_GetsMessageList_OutputsCorrectNumberOfEntries()
        {
            var target = new MessageContext();

            target.Add("Fact");

            var callbackTimes = 0;

            var logger = A.Fake <ILogWrapper>();

            A.CallTo(() => logger.Info(A <object> .Ignored)).Invokes(() => callbackTimes++);

            target.Dump(logger);

            var messageList = target.Get() as IList <string>;

            if (messageList == null)
            {
                throw new XunitException("Message list was null.");
            }

            messageList.Count.Should().Be(0);
            callbackTimes.Should().Be(1);
        }