|
|
@ -183,6 +183,34 @@ namespace Avalonia.Controls.UnitTests |
|
|
Assert.Equal("bar", presenter2.Content); |
|
|
Assert.Equal("bar", presenter2.Content); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void Logical_Children_Should_Not_Be_Duplicated() |
|
|
|
|
|
{ |
|
|
|
|
|
using var app = Start(); |
|
|
|
|
|
var (target, transition) = CreateTarget(""); |
|
|
|
|
|
target.PageTransition = null; |
|
|
|
|
|
|
|
|
|
|
|
var childControl = new Control(); |
|
|
|
|
|
target.Content = childControl; |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(1, target.LogicalChildren.Count); |
|
|
|
|
|
Assert.Equal(target.LogicalChildren[0], childControl); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void First_Presenter_Should_Register_TCC_As_His_Host() |
|
|
|
|
|
{ |
|
|
|
|
|
using var app = Start(); |
|
|
|
|
|
var (target, transition) = CreateTarget(""); |
|
|
|
|
|
target.PageTransition = null; |
|
|
|
|
|
|
|
|
|
|
|
var childControl = new Control(); |
|
|
|
|
|
target.Presenter!.Content = childControl; |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(1, target.LogicalChildren.Count); |
|
|
|
|
|
Assert.Equal(target.LogicalChildren[0], childControl); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private static IDisposable Start() |
|
|
private static IDisposable Start() |
|
|
{ |
|
|
{ |
|
|
return UnitTestApplication.Start( |
|
|
return UnitTestApplication.Start( |
|
|
|