Beispiel #1
0
        public void TestSerialize()
        {
            DateTime now = DateTime.Now;

            now.AddSeconds(TestRandomizer.GetDouble());
            now.AddDays(TestRandomizer.GetShort());

            string   xml     = xstream.ToXml(now);
            DateTime reverse = (DateTime)xstream.FromXml(xml);

            Assert.AreEqual(now, reverse);
        }
        public void TestSerialize()
        {
            StringBuilder sbuf = new StringBuilder(TestRandomizer.GetString());

            sbuf.Append(TestRandomizer.GetChar());
            sbuf.Append(TestRandomizer.GetDouble());

            string        xml = xstream.ToXml(sbuf);
            StringBuilder rev = xstream.FromXml(xml) as StringBuilder;

            Assert.IsNotNull(rev);
            Assert.AreEqual(sbuf.ToString(), rev.ToString());
        }
 protected override object GetValue()
 {
     return(TestRandomizer.GetDouble());
 }