Esempio n. 1
0
        public void PostProcessingTest1()
        {
            var soba = new Soba();

            soba.Register(new StubPrioZComponent());

            Assert.Equal
            (
                Value.TRUE,
                soba.Eval($"#[{nameof(StubPrioZComponent)} ... ]", true)
            );

            Assert.Equal
            (
                Value.FALSE,
                soba.Eval($"#[{nameof(StubPrioZComponent)} ... ]", false)
            );
        }
Esempio n. 2
0
        public void PriorityTest1()
        {
            var soba = new Soba();

            soba.Register(new StubUserVariableComponent(soba));
            soba.Register(new StubBoxComponent(soba));

            Assert.Equal
            (
                string.Empty,
                soba.Eval($"#[var name = #[{nameof(StubBoxComponent)} ...] ]")
            );

            Assert.Equal
            (
                $"[{nameof(StubBoxComponent)} ......]",
                soba.Eval($"#[{nameof(StubBoxComponent)} ...#[var name = 123]...]")
            );
        }
Esempio n. 3
0
        public void PriorityTest10()
        {
            var soba = new Soba();
            var prio = new TPrioAB();

            soba.Register(new StubPrioBComponent(prio, true));
            soba.Register(new StubPrioAComponent(prio, true));

            Assert.Equal
            (
                "A1A>[A ... = #[B ...] ]<A",
                soba.Eval("#[A ... = #[B ...] ]")
            );
        }
Esempio n. 4
0
        public void PriorityTest3()
        {
            var soba = new Soba();
            var prio = new TPrioAB();

            soba.Register(new StubPrioBComponent(prio, false));
            soba.Register(new StubPrioAComponent(prio, false));

            Assert.Equal
            (
                "A2A>[A ... = B1B>[B ...]<B ]<A",
                soba.Eval("#[A ... = #[B ...] ]")
            );
        }