Пример #1
0
        public void Rendering_the_state_machine_with_graphviz()
        {
            var machine = new StateMachine<CreditRequest>(
                new ScanningStateProvider<CreditRequest>(),
                new CreditRequest());

            var renderer = new GraphvizRenderer();
            renderer.Render(machine);

            _output.WriteLine("Copy and paste the following output into http://www.webgraphviz.com/ :");

            _output.WriteLine(renderer.Output);
        }
Пример #2
0
        public void Rendering_a_simple_graph()
        {
            var allStates = new State<LightsSwitches>[]
            {
                new LightOff(),
                new LightOnDim(),
                new LightOnFull(),
            };

            var switches = new LightsSwitches();
            var machine = new StateMachine<LightsSwitches>(new ManualStateProvider<LightsSwitches>(allStates), switches);

            var renderer = new GraphvizRenderer();
            renderer.Render(machine);

            _output.WriteLine(renderer.Output);
            renderer.Output.ShouldBe(GraphDsl);
        }