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.
 
 
 

24 lines
619 B

using Avalonia.Data.Core;
using Xunit;
namespace Avalonia.Base.UnitTests.Data;
public class ReflectionClrPropertyInfoTests
{
public class TestClass
{
public string? Test { get; set; }
}
[Fact]
public void Can_Compile()
{
var propertyInfo = new ReflectionClrPropertyInfo(
typeof(TestClass).GetProperty(nameof(TestClass.Test))!);
var target = new TestClass();
const string result = "qwerty";
propertyInfo.Set(target, result);
Assert.Equal(result, target.Test);
Assert.Equal(result, (string?)propertyInfo.Get(target));
}
}