Пример #1
0
        public void CreatesBlockInRoot()
        {
            var media = new YamlMedia();

            media.Block("root")
            .Prop("key")
            .Put("value");

            Assert.Contains(
                "value",
                media.Content()
                );
        }
Пример #2
0
        public void BuildsBlockInBlock()
        {
            var media = new YamlMedia();

            media.Block("root")
            .Block("contents");

            Assert.Equal(
                "root:\r\n  contents:\r\n",
                media.Content(),
                false,
                true,
                false
                );
        }
Пример #3
0
        public void CreatesBlockInProp()
        {
            var media = new YamlMedia();

            media.Block("root")
            .Prop("my-block")
            .Block("contents");

            Assert.Equal(
                "root:\r\n  my-block:  contents:\r\n",
                media.Content(),
                false,
                true,
                false
                );
        }
Пример #4
0
        public void CreatesPropertyInBlock()
        {
            var media = new YamlMedia();

            media.Block("root")
            .Prop("key")
            .Put("lock");

            Assert.Equal(
                "root:\r\n  key: lock\r\n",
                media.Content().ToString(),
                false,
                true,
                false
                );
        }
Пример #5
0
        public void CreatesArrayInBlock()
        {
            var media = new YamlMedia();

            media
            .Block("root")
            .Array("keys", "key");

            Assert.Equal(
                "root:\r\n  keys:\r\n",
                media.Content(),
                false,
                true,
                false
                );
        }