Exemple #1
0
 public void DiscoverFromFolder_Ok()
 {
     var itemDiscoverer = new ItemDiscoverer();
     var item = itemDiscoverer.DiscoverFromFolder(@"Data\Test");
     Assert.IsNotNull(item);
     Assert.AreEqual("Test", item.SynchItemData.Name);
     Assert.AreEqual(3,item.Items.Count);
     Assert.AreEqual(1,item.Items[0].Items.Count);
 }
Exemple #2
0
        private static void BuildFromFolder(string startFromFolder, string outputFile)
        {
            var itemDiscoverer = new ItemDiscoverer(startFromFolder);

            itemDiscoverer.DiscoveringFolder += new EventHandler<FolderDiscoveredArg>(itemDiscoverer_DiscoveringFolder);
            var synchItem = itemDiscoverer.DiscoverFromFolder(startFromFolder);

            XmlSerializer xmlSerializer = new XmlSerializer(typeof(SynchItem));

            using (FileStream fs = new FileStream(outputFile, FileMode.Create))
                xmlSerializer.Serialize(fs, synchItem);
        }
Exemple #3
0
 public void DiscoverFromFolder_NoFolder_Sent()
 {
     var itemDiscoverer = new ItemDiscoverer();
     itemDiscoverer.DiscoverFromFolder(null);
 }
Exemple #4
0
 public void DiscoverFromFolder_NoFolder_Exists()
 {
     var itemDiscoverer = new ItemDiscoverer();
     itemDiscoverer.DiscoverFromFolder(@"Data\Test1");
 }