Browse Source

Removed outdated tests

pull/2705/head
Nikita Tsukanov 7 years ago
parent
commit
991f767c3c
  1. 23
      tests/Avalonia.Controls.UnitTests/ItemsControlTests.cs
  2. 11
      tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_InTemplate.cs
  3. 23
      tests/Avalonia.Controls.UnitTests/Primitives/TemplatedControlTests.cs
  4. 21
      tests/Avalonia.Controls.UnitTests/TreeViewTests.cs

23
tests/Avalonia.Controls.UnitTests/ItemsControlTests.cs

@ -472,29 +472,6 @@ namespace Avalonia.Controls.UnitTests
Assert.Null(NameScope.GetNameScope((TextBlock)item));
}
[Fact(Skip="We are using name scopes from IServiceProvider now")]
public void DataTemplate_Created_Content_Should_Be_NameScope()
{
var items = new object[]
{
"foo",
};
var target = new ItemsControl
{
Template = GetTemplate(),
Items = items,
};
target.ApplyTemplate();
target.Presenter.ApplyTemplate();
var container = (ContentPresenter)target.Presenter.Panel.LogicalChildren[0];
container.UpdateChild();
Assert.NotNull(NameScope.GetNameScope((TextBlock)container.Child));
}
[Fact]
public void Focuses_Next_Item_On_Key_Down()
{

11
tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_InTemplate.cs

@ -136,17 +136,6 @@ namespace Avalonia.Controls.UnitTests.Presenters
Assert.Null(NameScope.GetNameScope((Control)target.Child));
}
[Fact(Skip = "We are using name scopes from IServiceProvider now")]
public void DataTemplate_Created_Control_Should_Be_NameScope()
{
var (target, _) = CreateTarget();
target.Content = "Foo";
Assert.IsType<TextBlock>(target.Child);
Assert.NotNull(NameScope.GetNameScope((Control)target.Child));
}
[Fact]
public void Assigning_Control_To_Content_Should_Not_Set_DataContext()
{

23
tests/Avalonia.Controls.UnitTests/Primitives/TemplatedControlTests.cs

@ -92,29 +92,6 @@ namespace Avalonia.Controls.UnitTests.Primitives
Assert.Empty(target.GetLogicalChildren());
}
[Fact(Skip = "We are using name scopes from IServiceProvider now")]
public void Templated_Child_Should_Be_NameScope()
{
var target = new TemplatedControl
{
Template = new FuncControlTemplate((_, __) => new Decorator
{
Child = new Panel
{
Children =
{
new TextBlock(),
new Border(),
}
}
}),
};
target.ApplyTemplate();
Assert.NotNull(NameScope.GetNameScope((Control)target.GetVisualChildren().Single()));
}
[Fact]
public void Templated_Children_Should_Have_TemplatedParent_Set()
{

21
tests/Avalonia.Controls.UnitTests/TreeViewTests.cs

@ -513,27 +513,6 @@ namespace Avalonia.Controls.UnitTests
Assert.Null(NameScope.GetNameScope((TreeViewItem)item));
}
[Fact(Skip = "Is this behavior needed anymore?")]
public void DataTemplate_Created_Item_Should_Be_NameScope()
{
var items = new object[]
{
"foo",
};
var target = new TreeView
{
Template = CreateTreeViewTemplate(),
Items = items,
};
target.ApplyTemplate();
target.Presenter.ApplyTemplate();
var item = target.Presenter.Panel.LogicalChildren[0];
Assert.NotNull(NameScope.GetNameScope((TreeViewItem)item));
}
[Fact]
public void Should_React_To_Children_Changing()
{

Loading…
Cancel
Save