Пример #1
0
        public void SerializeToString ()
        {
            var obj = new TestObject ();

            var yaml = context.CakeContext.SerializeYaml (obj);

            Assert.IsNotEmpty (yaml);
            Assert.AreEqual (SERIALIZED_YAML, yaml);
        }
Пример #2
0
        public void SerializeToFile ()
        {
            var obj = new TestObject ();

            var file = new FilePath ("./serialized.yaml");

            context.CakeContext.SerializeYamlToFile (file, obj);

            var yaml = System.IO.File.ReadAllText (file.MakeAbsolute (context.CakeContext.Environment).FullPath);

            Assert.IsNotEmpty (yaml);
            Assert.AreEqual (SERIALIZED_YAML, yaml);
        }