Browse Source

Unitests -> when they'll work Tickets: #192 and #408 should be fixed

pull/584/head
jogibear9988 11 years ago
parent
commit
7a09aa56b8
  1. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Tests.csproj
  2. 24
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/CollectionTests.cs
  3. 94
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs
  4. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Tests.csproj

@ -72,6 +72,7 @@ @@ -72,6 +72,7 @@
<Compile Include="Designer\OutlineView\SelectionTests.cs" />
<Compile Include="Designer\PlacementTests.cs" />
<Compile Include="Designer\SetPropertyTests.cs" />
<Compile Include="XamlDom\CollectionTests.cs" />
<Compile Include="XamlDom\ExampleClass.cs" />
<Compile Include="XamlDom\ExampleClassContainer.cs" />
<Compile Include="XamlDom\ExampleService.cs" />
@ -101,7 +102,5 @@ @@ -101,7 +102,5 @@
<Name>WpfDesign.Designer</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Designer\OutlineView" />
</ItemGroup>
<ItemGroup />
</Project>

24
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/CollectionTests.cs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Documents;
using System.Windows.Media.Animation;
using ICSharpCode.WpfDesign.XamlDom;
using NUnit.Framework;
namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class CollectionTests
{
[Test]
public void LineBreakNoCollection()
{
var isCollection = CollectionSupport.IsCollectionType(typeof(LineBreak));
Assert.IsFalse(isCollection);
}
}
}

94
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs

@ -140,5 +140,99 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom @@ -140,5 +140,99 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
</StackPanel>
</Page>");
}
[Test]
public void Resources2()
{
TestLoading(@"<UserControl
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<FrameworkElement.Resources>
<ResourceDictionary />
</FrameworkElement.Resources>
</UserControl>");
}
[Test]
public void Animation1()
{
TestLoading(@"<Window
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<Canvas>
<Button Width=""100"" Height=""100"" Canvas.Left=""8"" Canvas.Top=""8"">
<Button.Triggers>
<EventTrigger RoutedEvent=""Button.Loaded"">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration=""0:0:10""
From=""1""
To=""0""
Storyboard.TargetProperty=""Opacity"" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</Canvas>
</Window>");
}
[Test]
public void Animation2()
{
//Loaded Property has to be found, because this so also works in WPF
TestLoading(@"<Window
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<Canvas>
<Button Width=""100"" Height=""100"" Canvas.Left=""8"" Canvas.Top=""8"">
<Button.Triggers>
<EventTrigger RoutedEvent=""Loaded"">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration=""0:0:10""
From=""1""
To=""0""
Storyboard.TargetProperty=""Opacity"" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</Canvas>
</Window>");
}
[Test]
public void Animation3()
{
TestLoading(@"<Window
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
<Canvas>
<Button Width=""100"" Height=""100"" Canvas.Left=""8"" Canvas.Top=""8"">
<Button.Triggers>
<EventTrigger RoutedEvent=""Button.Loaded"">
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard>
<DoubleAnimation Duration=""0:0:10""
From=""1""
To=""0""
Storyboard.TargetProperty=""Opacity"" />
</Storyboard>
</BeginStoryboard.Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</Canvas>
</Window>");
}
}
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs

@ -70,7 +70,7 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -70,7 +70,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
if (property.IsAttached == false) {
foreach (XamlProperty p in properties) {
if (p.IsAttached == false && p.PropertyName == property.PropertyName)
Debug.Fail("duplicate property");
throw new XamlLoadException("duplicate property");
}
}
#endif

Loading…
Cancel
Save