Beispiel #1
0
        public void Modes()
        {
            var mode = new LexicalModeContext(LexicalMode.Selector);

            Assert.Equal(LexicalMode.Selector, mode.Current);

            mode.Enter(LexicalMode.Block);

            Assert.Equal(LexicalMode.Block, mode.Current);

            mode.Enter(LexicalMode.Value);

            Assert.Equal(LexicalMode.Value, mode.Current);

            mode.Leave(LexicalMode.Value);

            Assert.Equal(LexicalMode.Block, mode.Current);

            mode.Leave(LexicalMode.Block);

            Assert.Equal(LexicalMode.Selector, mode.Current);
        }
Beispiel #2
0
        public void Modes()
        {
            var mode = new LexicalModeContext(LexicalMode.Selector);

            Assert.Equal(LexicalMode.Selector, mode.Current);

            mode.Enter(LexicalMode.Block);

            Assert.Equal(LexicalMode.Block, mode.Current);

            mode.Enter(LexicalMode.Value);

            Assert.Equal(LexicalMode.Value, mode.Current);

            mode.Leave(LexicalMode.Value);

            Assert.Equal(LexicalMode.Block, mode.Current);

            mode.Leave(LexicalMode.Block);

            Assert.Equal(LexicalMode.Selector, mode.Current);
        }