public void can_write_a_null_message()
        {
            var writer = new ObjectWriterStub();

            writer.WriteMessage(null);
            Assert.Null(writer.Graphs[0]);
        }
        public void composite_messages_are_expanded_when_written()
        {
            var writer = new ObjectWriterStub();
            var graph = new CompositeMessage(
                EndOfSessionMessage.Instance,
                new CompositeMessage(
                        StartSessionTimeCountdownMessage.Instance,
                        new CompositeMessage(StopSessionTimeCountdownMessage.Instance)));

            writer.WriteMessage(graph);
            Assert.Equal(3, writer.Graphs.Count);
            Assert.Same(EndOfSessionMessage.Instance, writer.Graphs[0]);
            Assert.Same(StartSessionTimeCountdownMessage.Instance, writer.Graphs[1]);
            Assert.Same(StopSessionTimeCountdownMessage.Instance, writer.Graphs[2]);
        }