Ejemplo n.º 1
0
        public void SerializeTest()
        {
            YamlConverter yamlConverter = new YamlConverter();
            var           addrss        = new Address()
            {
                City   = "City",
                State  = "State",
                Street = "Street"
            };
            var value = yamlConverter.Serialize(addrss);

            Assert.AreEqual("street: Street\r\ncity: City\r\nstate: State\r\n", value);
        }
Ejemplo n.º 2
0
        public void DeserializeTest1()
        {
            YamlConverter yamlConverter = new YamlConverter();
            var           addrss        = new Address()
            {
                City   = "City",
                State  = "State",
                Street = "Street"
            };
            var value  = yamlConverter.Serialize(addrss);
            var actual = yamlConverter.Deserialize(value, typeof(Address));

            Assert.AreEqual("City", (actual as Address).City);
        }