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 ); }
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 ); }
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 ); }
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 ); }
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 ); }
public void ShallowClone() { var page = new Page { InternalName = "SomePage" }; var result = page.Clone( false ); Assert.Equal( result.InternalName, page.InternalName ); }