A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
909 B

// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Perspex.Markup.Xaml.Templates;
using Xunit;
namespace Perspex.Markup.Xaml.UnitTests.Templates
{
public class DataTemplateTests
{
[Fact]
public void DataTemplate_Should_Match_Data_Of_Type()
{
var target = new DataTemplate { DataType = typeof(Class1) };
var data = new Class1();
Assert.True(target.Match(data));
}
[Fact]
public void DataTemplate_Should_Match_Data_Of_Derived_Type()
{
var target = new DataTemplate { DataType = typeof(Class1) };
var data = new Class2();
Assert.True(target.Match(data));
}
private class Class1 { }
private class Class2 : Class1 { }
}
}