Example #1
0
        public void RemovesProp()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            comb.Props().Refined("name", "value", "value2");
            comb.Props().Refined("name");
            Assert.Empty(
                comb.Props().Names()
                );
        }
Example #2
0
        public void HasArrayProps()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            comb.Props().Refined("name", "value", "value2");
            Assert.Equal(
                new ManyOf("value", "value2"),
                comb.Props().Values("name")
                );
        }
Example #3
0
        public void HasProps()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            comb.Props().Refined("name", "value");
            Assert.Equal(
                "value",
                comb.Props().Value("name")
                );
        }
Example #4
0
        public void DeliversXocument()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            using (var xoc = comb.Xocument("some.xml"))
            {
                Assert.Equal(
                    1,
                    xoc.Nodes("/some").Count
                    );
            }
        }
Example #5
0
        public void XocumentRootSkipsSubDir()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            using (var xoc = comb.Xocument("sub/some.xml"))
            {
                Assert.Equal(
                    1,
                    xoc.Nodes("/some").Count
                    );
            }
        }
Example #6
0
        public void IsCaseSensitive()
        {
            var comb = new RamComb("my-comb");

            using (var cell = comb.Cell("this-is/MY-cell"))
            {
                cell.Update(new InputOf("its so cold outside"));
            }
            using (var cell = comb.Cell("this-is\\MY-cell"))
            {
                Assert.Equal(
                    "its so cold outside",
                    new TextOf(cell.Content()).AsString()
                    );
            }
        }
Example #7
0
        public void IsInsensitiveToSeparatorChars()
        {
            var comb = new RamComb("my-comb");

            using (var cell = comb.Cell("this-is/my-cell"))
            {
                cell.Update(new InputOf("its so hot outside"));
            }
            using (var cell = comb.Cell("this-is\\my-cell"))
            {
                Assert.Equal(
                    "its so hot outside",
                    new TextOf(cell.Content()).AsString()
                    );
            }
        }
Example #8
0
        public void RemembersSubPathXocument()
        {
            var memory = new RamMnemonic();
            var comb   = new RamComb("my-comb", memory);

            using (var xoc = comb.Xocument("sub/dir/some.xml"))
            {
                xoc.Modify(new Directives().Xpath("/some").Add("test"));
            }
            using (var xoc = comb.Xocument("sub/dir/some.xml"))
            {
                Assert.Equal(
                    1,
                    xoc.Nodes("/some/test").Count
                    );
            }
        }