From 11ebe62c03b11832e596dc44a66388f3beddf675 Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Thu, 8 Sep 2022 13:08:04 +0300 Subject: [PATCH] Fix tests. --- .../ExpressionObserverBuilderTests_Method.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/Avalonia.Markup.UnitTests/Parsers/ExpressionObserverBuilderTests_Method.cs b/tests/Avalonia.Markup.UnitTests/Parsers/ExpressionObserverBuilderTests_Method.cs index 72e0ac5e57..0e499ff256 100644 --- a/tests/Avalonia.Markup.UnitTests/Parsers/ExpressionObserverBuilderTests_Method.cs +++ b/tests/Avalonia.Markup.UnitTests/Parsers/ExpressionObserverBuilderTests_Method.cs @@ -19,12 +19,9 @@ namespace Avalonia.Markup.UnitTests.Parsers public int MethodWithReturn() => 0; - public int MethodWithReturnAndParameters(int i) => i; + public int MethodWithReturnAndParameter(object i) => (int)i; public static void StaticMethod() { } - - public static void ManyParameters(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) { } - public static int ManyParametersWithReturnType(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) => 1; } [Fact] @@ -42,10 +39,8 @@ namespace Avalonia.Markup.UnitTests.Parsers [Theory] [InlineData(nameof(TestObject.MethodWithoutReturn), typeof(Action))] [InlineData(nameof(TestObject.MethodWithReturn), typeof(Func))] - [InlineData(nameof(TestObject.MethodWithReturnAndParameters), typeof(Func))] + [InlineData(nameof(TestObject.MethodWithReturnAndParameter), typeof(Func))] [InlineData(nameof(TestObject.StaticMethod), typeof(Action))] - [InlineData(nameof(TestObject.ManyParameters), typeof(Action))] - [InlineData(nameof(TestObject.ManyParametersWithReturnType), typeof(Func))] public async Task Should_Get_Method_WithCorrectDelegateType(string methodName, Type expectedType) { var data = new TestObject(); @@ -61,10 +56,10 @@ namespace Avalonia.Markup.UnitTests.Parsers public async Task Can_Call_Method_Returned_From_Observer() { var data = new TestObject(); - var observer = ExpressionObserverBuilder.Build(data, nameof(TestObject.MethodWithReturnAndParameters)); + var observer = ExpressionObserverBuilder.Build(data, nameof(TestObject.MethodWithReturnAndParameter)); var result = await observer.Take(1); - var callback = (Func)result; + var callback = (Func)result; Assert.Equal(1, callback(1));