예제 #1
0
        public void NauReaderCanReadFeed3()
        {
            const string NauUpdateFeed =
                @"<?xml version=""1.0"" encoding=""utf-8""?>
<Feed>
  <Title>My application</Title>
  <Link>http://myapp.com/</Link>
  <Tasks>
    <FileUpdateTask localPath=""test.dll"" updateTo=""remoteFile.dll"" hotswap=""true"">
      <Description>update details</Description>
      <Conditions>
        <OSCondition bit=""64"" />
      </Conditions>
    </FileUpdateTask>
  </Tasks>
</Feed>";

            var reader  = new NauXmlFeedReader();
            var updates = reader.Read(NauUpdateFeed);

            Assert.IsTrue(updates.Count == 1);

            var task = updates[0] as FileUpdateTask;

            Assert.IsNotNull(task);
            Assert.IsTrue(task.CanHotSwap);

            Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount);

            var cnd = task.UpdateConditions.Degrade() as OSCondition;

            Assert.IsNotNull(cnd);

            Assert.AreEqual(64, cnd.OsBits);
        }
예제 #2
0
        private void ReadUpdateFeed(IUpdateSource sc)
        {
            IUpdateFeedReader fr = new NauXmlFeedReader();

            var tasks = fr.Read(sc.GetUpdatesFeed());

            Assert.IsNotNull(tasks);
            Assert.IsTrue(tasks.Count == 3);
            Assert.IsTrue(tasks[0].Description.StartsWith("��� - some non 7-bit chars"));
        }
예제 #3
0
        public void NauReaderCanReadFeed1()
        {
            const string NauUpdateFeed =
                @"<?xml version=""1.0"" encoding=""utf-8""?>
<Feed>
  <Title>My application</Title>
  <Link>http://myapp.com/</Link>
  <Tasks>
    <FileUpdateTask localPath=""test.dll"" updateTo=""remoteFile.dll"">
      <Description>update details</Description>
      <Conditions>
        <FileExistsCondition localPath=""otherFile.dll"" />
      </Conditions>
    </FileUpdateTask>
  </Tasks>
</Feed>";

            var reader  = new NauXmlFeedReader();
            var updates = reader.Read(NauUpdateFeed);

            Assert.IsTrue(updates.Count == 1);

            var task = updates[0] as FileUpdateTask;

            Assert.IsNotNull(task);
            Assert.IsFalse(task.CanHotSwap);
            Assert.AreEqual("test.dll", task.LocalPath);
            Assert.AreEqual("remoteFile.dll", task.UpdateTo);
            Assert.IsNull(task.Sha256Checksum);
            Assert.IsNotNull(task.Description);

            Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount);

            var cnd = task.UpdateConditions.Degrade() as FileExistsCondition;

            Assert.IsNotNull(cnd);
            Assert.AreEqual("otherFile.dll", cnd.LocalPath);
        }