Beispiel #1
0
 public void CloneChildren()
 {
     var children = new List<Page> { new Page() };
     var parent = new Page { Pages = children };
     var result = parent.Clone() as Page;
     Assert.NotEmpty( result.Pages );
 }
Beispiel #2
0
 public void ClonePageRoutes()
 {
     var page = new Page { PageRoutes = new List<PageRoute>() };
     page.PageRoutes.Add( new PageRoute() );
     var result = page.Clone() as Page;
     Assert.NotNull( result.PageRoutes );
     Assert.NotEmpty( result.PageRoutes );
 }
Beispiel #3
0
 public void ClonePageContexts()
 {
     var page = new Page { PageContexts = new List<PageContext>() };
     page.PageContexts.Add( new PageContext() );
     var result = page.Clone() as Page;
     Assert.NotNull( result.PageContexts );
     Assert.NotEmpty( result.PageContexts );
 }
Beispiel #4
0
 public void CloneBlocks()
 {
     var page = new Page { Blocks = new List<Block>() };
     page.Blocks.Add( new Block() );
     var result = page.Clone() as Page;
     Assert.NotNull( result.Blocks );
     Assert.NotEmpty( result.Blocks );
 }
Beispiel #5
0
 public void CloneChildrenRecursively()
 {
     var parent = new Page();
     var child = new Page();
     var grandchild = new Page();
     parent.Pages = new List<Page> { child };
     child.Pages = new List<Page> { grandchild };
     var result = parent.Clone() as Page;
     Assert.NotEmpty( result.Pages );
     Assert.NotEmpty( result.Pages.FirstOrDefault().Pages );
 }
Beispiel #6
0
 public void ShallowClone()
 {
     var page = new Page { InternalName = "SomePage" };
     var result = page.Clone( false );
     Assert.Equal( result.InternalName, page.InternalName );
 }