예제 #1
0
        public void DateTimeTest()
        {
            DateTime    dateTime       = DateTime.Now;
            ClientPath  cp             = new ClientPath("c:\foobarclient");
            VersionSpec vs             = new DateTimeVersion(dateTime);
            FileSpec    target         = new FileSpec(cp, vs);
            string      dateTimeString = vs.ToString();
            string      expected       = String.Format("@{0}", dateTime.ToString("yyyy/MM/dd:HH:mm:ss"));

            Assert.AreEqual(expected, dateTimeString);

            dateTime       = DateTime.Now;
            cp             = new ClientPath("c:\foobarclient");
            vs             = new DateTimeVersion(dateTime);
            target         = new FileSpec(cp, vs);
            dateTimeString = vs.ToString();
            expected       = cp.ToString() + "@" + dateTime.ToString("yyyy/MM/dd:HH:mm:ss");
            Assert.AreEqual(expected, FileSpec.ToStrings(target)[0]);
        }