Пример #1
0
        public void ReplicatedItem_CanParseID()
        {
            var fd = new FileData();

            fd.Name    = "page_1234_666.xml";
            fd.Updated = DateTime.Now;
            var ri = new ReplicatedItem(fd);

            Assert.AreEqual(1234, ri.ID);
        }
Пример #2
0
        public void ReplicatedItem_CanCompareDates()
        {
            var fd = new FileData();

            fd.Name    = "1";
            fd.Updated = DateTime.Now;
            var ri = new ReplicatedItem(fd);

            Assert.That(ri.PublishedDateEquals(fd.Updated));
            Assert.That(ri.PublishedDateEquals(fd.Updated.ToUniversalTime()));
            Assert.That(ri.IsOlderThan(DateTime.Now.AddSeconds(1)));
            Assert.That(ri.IsNewerThan(DateTime.Now.AddMinutes(-1)));
        }