Ejemplo n.º 1
0
        public void Single_flow()
        {
            var tr = new StringReader("a,b\nb,c\nc,d");

            var portnames = FlowLoader.LoadFromReader("x", tr).SelectMany(s => new[] { s.FromPort.Fullname, s.ToPort.Fullname });

            Assert.That(portnames.ToArray(), Is.EqualTo(new[] { "x/a", "x/b", "x/b", "x/c", "x/c", "x/d" }));
        }
Ejemplo n.º 2
0
        public void Comments_and_whitespace()
        {
            var tr = new StringReader(@"
                                        a, b // comment
                                        b,  c
                                        // comment
                                        c,   d
                                       ");

            var portnames = FlowLoader.LoadFromReader("x", tr).SelectMany(s => new[] { s.FromPort.Fullname, s.ToPort.Fullname });

            Assert.That(portnames.ToArray(), Is.EqualTo(new[] { "x/a", "x/b", "x/b", "x/c", "x/c", "x/d" }));
        }
Ejemplo n.º 3
0
        public void Flow_port_translation()
        {
            var tr = new StringReader(@"
                                        .in, f.in
                                        f.out, .out

                                        f
                                        .in, g
                                        g, .out

                                        g
                                        ., x
                                        x, .
                                       ");

            var portnames = FlowLoader.LoadFromReader("/", tr).SelectMany(s => new[] { s.FromPort.Fullname, s.ToPort.Fullname });

            Assert.That(portnames.ToArray(), Is.EqualTo(new[] { ".in", "f.in", "f.out", ".out", "f/.in", "f/g", "f/g", "f/.out", "g/", "g/x", "g/x", "g/" }));
        }
Ejemplo n.º 4
0
        public void Multiple_flows()
        {
            var tr = new StringReader(@"
                                        a, b
                                        b,  c
                                        // comment
                                        f
                                        c,   d

                                        g // comment
                                        d,e
                                        f,g

                                        /
                                        h,i
                                       ");

            var portnames = FlowLoader.LoadFromReader("x", tr).SelectMany(s => new[] { s.FromPort.Fullname, s.ToPort.Fullname });

            Assert.That(portnames.ToArray(), Is.EqualTo(new[] { "x/a", "x/b", "x/b", "x/c", "f/c", "f/d", "g/d", "g/e", "g/f", "g/g", "h", "i" }));
        }