Exemple #1
0
        public void RestoreTo(WikiName name, WikiVersion version)
        {
            Wiki o = dbManager.GetWikiByVerslion(name, version);
            Wiki n = new Wiki();
            n.Name = o.Name;
            n.Content = o.Content;

            dbManager.WriteWiki(n);
        }
Exemple #2
0
        public void AddWikiTest()
        {
            Guid wiki_name = Guid.NewGuid();
            WikiName name = new WikiName(wiki_name.ToString());
            WikiContent content = new WikiContent("this is wiki content...");
            Wiki wiki = new Wiki();

            wiki.Name = name;
            wiki.Content = content;

            WikiManager wm = new WikiManager();
            wm.WriteWiki(wiki);
            Wiki dbWiki = wm.GetWiki(name, new WikiVersion(1));

            Assert.IsTrue(wm.GetWikiList(name).Count == 1);
            Assert.IsTrue(wiki.Version.Value == 1);
        }
Exemple #3
0
        public void GetWikisTest()
        {
            Int32 count = 10;
            WikiManager wm = new WikiManager();
            Guid wiki_name = Guid.NewGuid();
            WikiName name = new WikiName(wiki_name.ToString());

            for (int i = 0; i < count; i++)
            {
                WikiContent content = new WikiContent(string.Format("this is wiki content...{0}", i));

                Wiki wiki = new Wiki();
                wiki.Name = name;
                wiki.Content = content;

                wm.WriteWiki(wiki);
            }

            List<Wiki> list = wm.GetWikiList(name);
            Assert.IsTrue(count == list.Count);
        }
Exemple #4
0
 public void WriteWiki(WikiName name, WikiContent content)
 {
     dbManager.WriteWiki(name, content);
 }
Exemple #5
0
 public List<Wiki> GetWikiList(WikiName name)
 {
     return dbManager.GetWikisByName(name);
 }
Exemple #6
0
 public Wiki GetWiki(WikiName name, WikiVersion version)
 {
     return dbManager.GetWikiByVerslion(name, version);
 }
Exemple #7
0
 public WikiVersion GetLatestWikiVersion(WikiName name)
 {
     return dbManager.GetLatestVersion(name);
 }
Exemple #8
0
 public Wiki GetLatestWiki(WikiName name)
 {
     return this.dbManager.GetLatestWiki(name);
 }