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) {