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 @@ -81,10 +81,23 @@ namespace ICSharpCode.WpfDesign.Tests.Designer
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]
public void PasteWhenContentControlSelectedAndCannotAdd()
{
var grid = IntializePasteOperationsTest();
var grid = IntializePasteOperationsCannotAddTest();
var xamlContext = grid.Context as XamlDesignContext;
Assert.IsNotNull(xamlContext);
@ -92,7 +105,7 @@ namespace ICSharpCode.WpfDesign.Tests.Designer @@ -92,7 +105,7 @@ namespace ICSharpCode.WpfDesign.Tests.Designer
var innerGrid = grid.ContentProperty.CollectionElements[0];
selection.SetSelectedComponents(innerGrid.ContentProperty.CollectionElements);
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);
}

Loading…
Cancel
Save