Ejemplo n.º 1
0
        public void StOutParseTest2()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv
                                          (
                                              "raw",
                                              new List <string>()
            {
                "err1"
            },
                                              new List <string>()
            {
                "warn1", "warn2"
            }
                                          ));

            Assert.Equal("raw", target.Eval("[OWP out.All]"));
            Assert.Equal("raw", target.Eval("[OWP out]"));
            Assert.Equal("raw", target.Eval("[OWP out.Warnings.Raw]"));
            Assert.Equal("raw", target.Eval("[OWP out.Warnings]"));
            Assert.Equal("2", target.Eval("[OWP out.Warnings.Count]"));
            Assert.Equal("warn1,warn2", target.Eval("[OWP out.Warnings.Codes]"));
            Assert.Equal("raw", target.Eval("[OWP out.Errors.Raw]"));
            Assert.Equal("raw", target.Eval("[OWP out.Errors]"));
            Assert.Equal("1", target.Eval("[OWP out.Errors.Count]"));
            Assert.Equal("err1", target.Eval("[OWP out.Errors.Codes]"));
        }
Ejemplo n.º 2
0
        public void StItemActivateParseTest2()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Equal(Value.From(false), target.Eval("[OWP item(\"name\").activate = false]"));
            Assert.Equal(Value.From(true), target.Eval("[OWP item(\"name\").activate = true]"));
        }
Ejemplo n.º 3
0
        public void StLogParseTest3()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Equal(Value.Empty, target.Eval("[OWP log.Message]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP log.Level]"));
        }
Ejemplo n.º 4
0
        public void StItemWriteParseTest3()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Equal(Value.Empty, target.Eval("[OWP item(\"name\").write(false): multi\nline\" \n 'data'.]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP item(\"name\").write(true): multi\nline\" \n 'data'.]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP item(\"name\").writeLine(false): multi\nline\" \n 'data'.]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP item(\"name\").writeLine(true): multi\nline\" \n 'data'.]"));
        }
Ejemplo n.º 5
0
        public void StOutParseTest5()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[OWP out()]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[OWP out().All]")
                                             );
        }
Ejemplo n.º 6
0
        public void StOutParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Equal(Value.Empty, target.Eval("[OWP out.All]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Warnings.Raw]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Warnings]"));
            Assert.Equal("0", target.Eval("[OWP out.Warnings.Count]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Warnings.Codes]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Errors.Raw]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Errors]"));
            Assert.Equal("0", target.Eval("[OWP out.Errors.Count]"));
            Assert.Equal(Value.Empty, target.Eval("[OWP out.Errors.Codes]"));
        }
Ejemplo n.º 7
0
        public void ParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("#[OWP out.Warnings.Count]")
                                                     );

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("OWP out.Warnings.Count")
                                                     );

            Assert.Throws <SubtypeNotFoundException>(() =>
                                                     target.Eval("[OWP NotFound.Test]")
                                                     );
        }
Ejemplo n.º 8
0
        public void StItemActivateParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   Assert.Equal(Value.Empty, target.Eval("[OWP item(\"name\").activate]"))
                                                   );
        }
Ejemplo n.º 9
0
        public void StItemWriteParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP item(\"name\").write(\"false\"): ]")
                                                   );
        }
Ejemplo n.º 10
0
        public void StItemParseTest4()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[OWP item(name).write(false): ]")
                                             );
        }
Ejemplo n.º 11
0
        public void StItemParseTest3()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[OWP item(\"\").write(false): ]")
                                                           );
        }
Ejemplo n.º 12
0
        public void StItemParseTest2()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP item(\"name\").NotSupportedTest]")
                                                   );
        }
Ejemplo n.º 13
0
        public void StLogParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP log]")
                                                   );
        }
Ejemplo n.º 14
0
        public void StOutParseTest7()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <NotFoundException>(() =>
                                              target.Eval($"[OWP out(\"{NullOwpEnv.MOCK_ITEM_NAME}\").Warnings.Raw]")
                                              );
        }
Ejemplo n.º 15
0
        public void StOutParseTest4()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP out.NotRealPropertyTest]")
                                                   );
        }
Ejemplo n.º 16
0
        public void StOutParseTest6()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[OWP out.All.NotRealProperty]")
                                                           );

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[OWP out.Warnings.NotRealProperty]")
                                                           );

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[OWP out.Warnings.Codes.NotRealProperty]")
                                                           );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP out.NotRealProperty]")
                                                   );

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[OWP out.Warnings.Count = 12]")
                                                           );
        }