Created
September 17, 2014 04:14
-
-
Save rofr/03e635ddb6beea5dae7d to your computer and use it in GitHub Desktop.
Building a CMS with OrigoDB - snippet 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod()] | |
public void MenuSmokeTest() | |
{ | |
var engine = Engine.LoadOrCreate<CmsModel>("c:\\livedb\\cms"); | |
var page = new Page(Guid.NewGuid(), DateTime.Now); | |
page.Contents = "Hello, world!"; | |
Command command = new PutPageCommand(page); | |
engine.Execute(command); | |
Menu menu = new Menu{Name = "_main"}; | |
menu.Items.Add(new ExternalMenuItem{ Name = "squash", Url = "http://psasquashtv.com/"}); | |
menu.Items.Add(new ExternalMenuItem{ Name = "livedb", Url = "http://livedb.devrex.se/"}); | |
menu.Items.Add(new InternalMenuItem{Name = page.Title, PageId = page.Id}); | |
var subMenu = new Menu(){Name = "Events"}; | |
menu.Items.Add(subMenu); | |
subMenu.Items.Add(new ExternalMenuItem{ Name = "News", Url = "http://dn.se/"}); | |
command = new PutMenuCommand(menu); | |
engine.Execute(command); | |
engine.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment