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); }
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); }
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); }
public void WriteWiki(WikiName name, WikiContent content) { dbManager.WriteWiki(name, content); }
public List<Wiki> GetWikiList(WikiName name) { return dbManager.GetWikisByName(name); }
public Wiki GetWiki(WikiName name, WikiVersion version) { return dbManager.GetWikiByVerslion(name, version); }
public WikiVersion GetLatestWikiVersion(WikiName name) { return dbManager.GetLatestVersion(name); }
public Wiki GetLatestWiki(WikiName name) { return this.dbManager.GetLatestWiki(name); }