Browse Source

Fix Cannot Add Test, because Button can now recieve Content! So use a Image instead!

pull/52/head
jkuehner 12 years ago
parent
commit
b4f3ac6345
  1. 17
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/EditOperationTests.cs

17
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/EditOperationTests.cs

@ -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);
} }

Loading…
Cancel
Save