From 49c556dc43e4a218d3ff96ac5c257d7f581e7a6a Mon Sep 17 00:00:00 2001 From: Nandin Borjigin Date: Wed, 23 Feb 2022 23:20:27 +0800 Subject: [PATCH] [UITestMethod] should invoke test method with null (#1045) --- src/TestFramework/Extension.UWP/UITestMethodAttribute.cs | 2 +- src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs b/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs index 6382aee862..33d6bae6ef 100644 --- a/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs +++ b/src/TestFramework/Extension.UWP/UITestMethodAttribute.cs @@ -35,7 +35,7 @@ public override TestResult[] Execute(ITestMethod testMethod) Windows.UI.Core.CoreDispatcherPriority.Normal, () => { - result = testMethod.Invoke(new object[] { }); + result = testMethod.Invoke(null); }).AsTask().GetAwaiter().GetResult(); return new TestResult[] { result }; diff --git a/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs b/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs index 839a9d84eb..4b840591a3 100644 --- a/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs +++ b/src/TestFramework/Extension.WinUI/UITestMethodAttribute.cs @@ -48,7 +48,7 @@ public override TestResult[] Execute(ITestMethod testMethod) { try { - result = testMethod.Invoke(Array.Empty()); + result = testMethod.Invoke(null); } catch (Exception e) {