|
|
@ -81,10 +81,23 @@ namespace ICSharpCode.WpfDesign.Tests.Designer |
|
|
|
return grid; |
|
|
|
return grid; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DesignItem IntializePasteOperationsCannotAddTest() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var grid = CreateGridContextWithDesignSurface("<Button Name=\"TestElement\"/><Grid><Image/></Grid><Window/><ListBox/>"); |
|
|
|
|
|
|
|
Assert.IsNotNull(grid); |
|
|
|
|
|
|
|
var xamlConxtext = grid.Context as XamlDesignContext; |
|
|
|
|
|
|
|
if (xamlConxtext != null) { |
|
|
|
|
|
|
|
_name = grid.ContentProperty.CollectionElements[0].Name; |
|
|
|
|
|
|
|
xamlConxtext.XamlEditAction.Cut(new[] {grid.ContentProperty.CollectionElements[0]}); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
Assert.Fail(); |
|
|
|
|
|
|
|
return grid; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void PasteWhenContentControlSelectedAndCannotAdd() |
|
|
|
public void PasteWhenContentControlSelectedAndCannotAdd() |
|
|
|
{ |
|
|
|
{ |
|
|
|
var grid = IntializePasteOperationsTest(); |
|
|
|
var grid = IntializePasteOperationsCannotAddTest(); |
|
|
|
var xamlContext = grid.Context as XamlDesignContext; |
|
|
|
var xamlContext = grid.Context as XamlDesignContext; |
|
|
|
Assert.IsNotNull(xamlContext); |
|
|
|
Assert.IsNotNull(xamlContext); |
|
|
|
|
|
|
|
|
|
|
@ -92,7 +105,7 @@ namespace ICSharpCode.WpfDesign.Tests.Designer |
|
|
|
var innerGrid = grid.ContentProperty.CollectionElements[0]; |
|
|
|
var innerGrid = grid.ContentProperty.CollectionElements[0]; |
|
|
|
selection.SetSelectedComponents(innerGrid.ContentProperty.CollectionElements); |
|
|
|
selection.SetSelectedComponents(innerGrid.ContentProperty.CollectionElements); |
|
|
|
xamlContext.XamlEditAction.Paste(); |
|
|
|
xamlContext.XamlEditAction.Paste(); |
|
|
|
Assert.AreEqual(_name, innerGrid.ContentProperty.CollectionElements[1].Name); |
|
|
|
Assert.AreEqual(_name, innerGrid.ContentProperty.CollectionElements[1].Name); |
|
|
|
Assert.AreEqual(innerGrid.ContentProperty.CollectionElements[1], selection.PrimarySelection); |
|
|
|
Assert.AreEqual(innerGrid.ContentProperty.CollectionElements[1], selection.PrimarySelection); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|