Example #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]"));
        }
Example #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]"));
        }
Example #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]"));
        }
Example #4
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]"))
                                                   );
        }
Example #5
0
        public void StItemWriteParseTest1()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

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

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

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

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

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP log]")
                                                   );
        }
Example #10
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]")
                                              );
        }
Example #11
0
        public void StOutParseTest4()
        {
            var target = new OwpComponent(new Soba(), new NullOwpEnv());

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[OWP out.NotRealPropertyTest]")
                                                   );
        }
Example #12
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'.]"));
        }
Example #13
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]")
                                             );
        }
Example #14
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]"));
        }
Example #15
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]")
                                                     );
        }
Example #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]")
                                                           );
        }