diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 6beba7cb18..61c5f9fbd7 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -238,8 +238,7 @@ public static AppxManifestInfo ReadFromManifest(Stream manifestStream) ? null : new AppxApplicationInfo(applicationId, executable, $"{packageFamilyName}!{applicationId}"); }) - .Where(static application => application is not null) - .Select(static application => application!) + .OfType() .ToList() ?? []; diff --git a/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs b/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs index 9af9f29f3d..0f05a80246 100644 --- a/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs +++ b/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs @@ -106,10 +106,7 @@ public override async Task ExecuteAsync(ITestMethod testMethod) } private static Type? GetApplicationType(Assembly assembly) - { - WinUITestTargetAttribute? attribute = assembly.GetCustomAttribute(); - return attribute == null || attribute.ApplicationType == null ? null : attribute.ApplicationType; - } + => assembly.GetCustomAttribute()?.ApplicationType; private static DispatcherQueue? GetApplicationDispatcherQueue(Assembly assembly) {