diff --git a/src/TestApp/shared/MainPage.xaml.cs b/src/TestApp/shared/MainPage.xaml.cs index 9187375..c270472 100644 --- a/src/TestApp/shared/MainPage.xaml.cs +++ b/src/TestApp/shared/MainPage.xaml.cs @@ -1,5 +1,4 @@ - -#if HAS_UNO_WINUI || WINDOWS_WINUI +#if HAS_UNO_WINUI || WINDOWS_WINUI using Microsoft.UI.Xaml.Controls; #else using Windows.UI.Xaml.Controls; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestDevServerAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestDevServerAttribute.cs index b1c5474..d721d11 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestDevServerAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestDevServerAttribute.cs @@ -1,10 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER +#nullable enable + using System; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestEmbeddedRunner.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestEmbeddedRunner.cs index 3172730..c0bff17 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestEmbeddedRunner.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestEmbeddedRunner.cs @@ -1,14 +1,14 @@ -#if WINDOWS_UWP +#if !IS_UNO_RUNTIMETEST_PROJECT +#pragma warning disable +#endif + +#if WINDOWS_UWP #define UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER #endif #if !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER #nullable enable -#if !IS_UNO_RUNTIMETEST_PROJECT -#pragma warning disable -#endif - using System; using System.Diagnostics; using System.IO; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestsSourceProjectAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestsSourceProjectAttribute.cs index ba7113e..d14f7ca 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestsSourceProjectAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/RuntimeTestsSourceProjectAttribute.cs @@ -1,10 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER +#nullable enable + using System; using System.Collections.Generic; using System.Text; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/DevServer.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/DevServer.cs index 6b0b73e..38e5588 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/DevServer.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/DevServer.cs @@ -1,15 +1,15 @@ -using System; -using System.ComponentModel; -using System.IO; - -#if !UNO_RUNTIMETESTS_DISABLE_UI && HAS_UNO_WINUI // HAS_UNO_WINUI: exclude non net7 platforms -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1848 // Log perf #pragma warning disable CS1998 // No await +#nullable enable + +#if !UNO_RUNTIMETESTS_DISABLE_UI && HAS_UNO_WINUI // HAS_UNO_WINUI: exclude non net7 platforms +using System; +using System.ComponentModel; +using System.IO; + namespace Uno.UI.RuntimeTests.Internal.Helpers; /// diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/LogScope.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/LogScope.cs index d172499..cbe4a58 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/LogScope.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/LogScope.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_UI using System; using System.Linq; using Microsoft.Extensions.Logging; @@ -23,7 +22,7 @@ public static LogScope Scope(this ILogger log, string scopeName) #if false => new(log, log.BeginScope(scopeName)); #else - => new (Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory.CreateLogger(typeof(T).FullName + "#" + scopeName)); + => new(Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory.CreateLogger(typeof(T).FullName + "#" + scopeName)); #endif } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/ProcessHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/ProcessHelper.cs index 759dbd1..6dbcf8e 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/ProcessHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/ProcessHelper.cs @@ -1,11 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI && HAS_UNO_WINUI // HAS_UNO_WINUI: exclude non net7 platforms -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1848 // Log perf +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_UI && HAS_UNO_WINUI // HAS_UNO_WINUI: exclude non net7 platforms using System; using System.Diagnostics; using System.Text; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/SecondaryApp.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/SecondaryApp.cs index 2009fae..88ee505 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/SecondaryApp.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/ExternalRunner/_Private/SecondaryApp.cs @@ -1,12 +1,12 @@ -using System; +#if !IS_UNO_RUNTIMETEST_PROJECT +#pragma warning disable +#endif + +using System; #if !UNO_RUNTIMETESTS_DISABLE_UI #nullable enable -#if !IS_UNO_RUNTIMETEST_PROJECT -#pragma warning disable -#endif - namespace Uno.UI.RuntimeTests.Internal.Helpers; /// @@ -58,13 +58,13 @@ internal static partial class SecondaryApp try { var results = await global::System.Text.Json.JsonSerializer.DeserializeAsync(global::System.IO.File.OpenRead(resultFile), cancellationToken: ct); - + return results ?? global::System.Array.Empty(); } catch (global::System.Text.Json.JsonException error) { throw new global::System.InvalidOperationException( - $"Failed to deserialize the test results from '{resultFile}', this usually indicates that the secondary app has been closed (or crashed) before the end of the test suit.", + $"Failed to deserialize the test results from '{resultFile}', this usually indicates that the secondary app has been closed (or crashed) before the end of the test suit.", error); } } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCase.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCase.cs index f8986cd..92e525b 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCase.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCase.cs @@ -1,9 +1,8 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1852 // Make class final : unnecessary breaking change +#nullable enable using System; using System.Linq; @@ -25,7 +24,7 @@ public override string ToString() { var result = $"({string.Join(",", Parameters.Select(p => p?.ToString() ?? ""))})"; - if (Pointer is {} pt) + if (Pointer is { } pt) { result += $" [{pt}]"; } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCaseResult.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCaseResult.cs index be370cc..4f53d58 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCaseResult.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCaseResult.cs @@ -1,9 +1,8 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1852 // Make class final : unnecessary breaking change +#nullable enable using System; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestResult.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestResult.cs index 39acc24..f499957 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestResult.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestResult.cs @@ -1,6 +1,6 @@ #if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable -# endif +#endif using System; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.CustomConsoleOutput.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.CustomConsoleOutput.cs index f98e179..94997fc 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.CustomConsoleOutput.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.CustomConsoleOutput.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_UI using System; using System.Collections.Generic; using System.IO; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.TestRun.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.TestRun.cs index 71b570d..b4bff19 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.TestRun.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.TestRun.cs @@ -1,12 +1,11 @@ -namespace Uno.UI.RuntimeTests; - -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1852 // Make class final : unnecessary breaking change +namespace Uno.UI.RuntimeTests; + +#if !UNO_RUNTIMETESTS_DISABLE_UI public sealed partial class UnitTestsControl { private class TestRun diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs index fefe3ee..d31c7aa 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs @@ -1,13 +1,11 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously #pragma warning disable CA1848 // Use the LoggerMessage delegates +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_UI using System; using System.Collections.Generic; using System.Security.Cryptography; @@ -764,10 +762,10 @@ private async Task ExecuteTestsForInstance( if (results.Length != testCases.Count) { ReportTestResult( - instance.GetType().Name, - TimeSpan.Zero, - TestResult.Failed, - new InvalidOperationException($"Unexpected tests results, got {results.Length} test results from the secondary app for class {instance.GetType().Name} while we where expecting {testCases.Count}.\""), + instance.GetType().Name, + TimeSpan.Zero, + TestResult.Failed, + new InvalidOperationException($"Unexpected tests results, got {results.Length} test results from the secondary app for class {instance.GetType().Name} while we where expecting {testCases.Count}.\""), $"Got {results.Length} test results from the secondary app for class {instance.GetType().Name} while we where expecting {testCases.Count}."); } } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsUIContentHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsUIContentHelper.cs index 8a43207..39d088e 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsUIContentHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsUIContentHelper.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; using System.ComponentModel; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/_Private/UnitTestDispatcherCompat.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/_Private/UnitTestDispatcherCompat.cs index 1359e88..3de5b62 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/_Private/UnitTestDispatcherCompat.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/_Private/UnitTestDispatcherCompat.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_UI using System; using System.Collections.Generic; using System.Text; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestClassInfo.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestClassInfo.cs index 4211966..9cd74fd 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestClassInfo.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestClassInfo.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestEngineConfig.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestEngineConfig.cs index af9f3b4..911cbb3 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestEngineConfig.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestEngineConfig.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestFilter.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestFilter.cs index 635896e..8a5a35a 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestFilter.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestFilter.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI || !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_UI || !UNO_RUNTIMETESTS_DISABLE_EMBEDDEDRUNNER using System; using System.Linq; using System.Reflection; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestMethodInfo.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestMethodInfo.cs index 6635304..10b420d 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestMethodInfo.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Engine/UnitTestMethodInfo.cs @@ -1,11 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_UI - -#nullable enable -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1852 // Make class final : unnecessary breaking change +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_UI using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/AsyncAssert.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/AsyncAssert.cs index 16dfafc..86ac266 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/AsyncAssert.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/AsyncAssert.cs @@ -1,8 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY namespace Uno.UI.RuntimeTests; public static partial class AsyncAssert @@ -87,7 +87,7 @@ public static partial class AsyncAssert /// The max duration to wait for in milliseconds. /// Cancellation token to cancel teh asynchronous operation public static global::System.Threading.Tasks.ValueTask IsTrue(global::System.Func condition, string message, int timeoutMs, global::System.Threading.CancellationToken ct = default) - => IsTrueCore( condition, message, global::System.TimeSpan.FromMilliseconds(timeoutMs), ct); + => IsTrueCore(condition, message, global::System.TimeSpan.FromMilliseconds(timeoutMs), ct); /// /// Asynchronously tests whether the specified condition is true and throws an exception if the condition is false. diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.DevServer.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.DevServer.cs index bf636ab..eec3740 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.DevServer.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.DevServer.cs @@ -1,11 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && HAS_UNO_DEVSERVER // Set as soon as the DevServer package is referenced, cf. Uno.UI.RuntimeTests.Engine.targets -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1848 // Log perf +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && HAS_UNO_DEVSERVER // Set as soon as the DevServer package is referenced, cf. Uno.UI.RuntimeTests.Engine.targets using System; using System.Collections; using System.IO; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.Local.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.Local.cs index d566b65..48b8ddf 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.Local.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.Local.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY namespace Uno.UI.RuntimeTests; partial class HotReloadHelper diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.MetadataUpdateHandler.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.MetadataUpdateHandler.cs index 3fe0395..c45070d 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.MetadataUpdateHandler.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.MetadataUpdateHandler.cs @@ -1,10 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif -[assembly:System.Reflection.Metadata.MetadataUpdateHandlerAttribute(typeof(global::Uno.UI.RuntimeTests.HotReloadHelper.MetadataUpdateHandler))] +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY + +[assembly: System.Reflection.Metadata.MetadataUpdateHandlerAttribute(typeof(global::Uno.UI.RuntimeTests.HotReloadHelper.MetadataUpdateHandler))] namespace Uno.UI.RuntimeTests; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.NotSupported.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.NotSupported.cs index a99bc49..e17fb1a 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.NotSupported.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.NotSupported.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY namespace Uno.UI.RuntimeTests; public static partial class HotReloadHelper diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.cs index 049ecd2..89535e3 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/HotReloadHelper.cs @@ -1,13 +1,11 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif - #pragma warning disable CA1848 // Log perf #pragma warning disable CA1823 // Field not used +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY // Add using for extensions methods only using global::System.Reflection; using global::Microsoft.Extensions.Logging; @@ -190,7 +188,7 @@ public static void Use(IFileUpdater updater) catch { await revertMessage.DisposeAsync(); - + throw; } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.ExpectedPixels.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.ExpectedPixels.cs index 804c75c..872a208 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.ExpectedPixels.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.ExpectedPixels.cs @@ -1,11 +1,10 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif #pragma warning disable CA1814 // We use 2D Color[] on purpose +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections; using System.Collections.Generic; @@ -92,10 +91,10 @@ public ExpectedPixels Pixels(TestBitmap source, Rect rect) { var colors = new Color[(int)rect.Height, (int)rect.Width]; for (var py = 0; py < rect.Height; py++) - for (var px = 0; px < rect.Width; px++) - { - colors[py, px] = source.GetPixel((int)rect.X + px, (int)rect.Y + py); - } + for (var px = 0; px < rect.Width; px++) + { + colors[py, px] = source.GetPixel((int)rect.X + px, (int)rect.Y + py); + } return this with { SourceLocation = new Point(rect.X, rect.Y), Values = colors }; } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.Validations.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.Validations.cs index 3e2bfdf..0f3c2c2 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.Validations.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.Validations.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.cs index 4159b63..dca9329 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/ImageAssert.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Runtime.CompilerServices; using System.Text; @@ -113,12 +112,12 @@ string WithContext(string? message = null, Action? builder = null .AppendLine($"ImageAssert.HasColorAt @ line {line}") .AppendLine("===================="); - if (message is not null) - { - sb.AppendLine(message); - } - builder?.Invoke(sb); - + if (message is not null) + { + sb.AppendLine(message); + } + builder?.Invoke(sb); + return sb.ToString(); } } @@ -162,7 +161,7 @@ string WithContext(string? message = null, Action? builder = null sb.AppendLine(message); } builder?.Invoke(sb); - + return sb.ToString(); } } diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.MouseHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.MouseHelper.cs index d3f447b..780dedc 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.MouseHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.MouseHelper.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.cs index 41f8b93..72c82ae 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelper.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelperExtensions.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelperExtensions.cs index ceb4ac9..86ace23 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelperExtensions.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/InputInjectorHelperExtensions.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Linq; @@ -77,7 +76,7 @@ public static void TapCoordinates(this InputInjectorHelper injector, double x, d public static void Drag(this InputInjectorHelper injector, UIElement elt, Point to) => injector.DragCoordinates(GetAbsoluteCenter(elt), to); - + public static void Drag(this InputInjectorHelper injector, UIElement elt, double toX, double toY) => injector.DragCoordinates(GetAbsoluteCenter(elt), new Point(toX, toY)); diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs index 055afea..b4fb444 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestBitmap.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.IO; using System.Linq; @@ -37,7 +36,7 @@ public partial class TestBitmap private readonly UIElement _renderedElement; // Allow access through partial implementation private readonly double _implicitScaling; - private byte[]? _pixels; + private byte[]? _pixels; private bool _altered; private TestBitmap(RenderTargetBitmap bitmap, UIElement renderedElement, double implicitScaling) diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestHelper.cs index 3370bbc..dc50b62 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/TestHelper.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Text; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs index ac2dcfa..0fcc20e 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/Helpers/UIHelper.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/InjectedPointerAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/InjectedPointerAttribute.cs index a14db80..dfe2dec 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/InjectedPointerAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/InjectedPointerAttribute.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RequiresFullWindowAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RequiresFullWindowAttribute.cs index d674bda..35d50a4 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RequiresFullWindowAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RequiresFullWindowAttribute.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsInSecondaryAppAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsInSecondaryAppAttribute.cs index 362841f..ccf17fb 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsInSecondaryAppAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsInSecondaryAppAttribute.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsOnUIThreadAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsOnUIThreadAttribute.cs index 8a2028b..651193e 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsOnUIThreadAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/RunsOnUIThreadAttribute.cs @@ -1,8 +1,7 @@ -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable using System; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/CallerArgumentExpressionAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/CallerArgumentExpressionAttribute.cs index 6f97d2b..77a4ca4 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/CallerArgumentExpressionAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/CallerArgumentExpressionAttribute.cs @@ -1,8 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && WINDOWS_UWP -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && WINDOWS_UWP using System; using System.Collections.Generic; using System.Text; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/MetadataUpdateHandlerAttribute.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/MetadataUpdateHandlerAttribute.cs index 05ac5f6..d71093c 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/MetadataUpdateHandlerAttribute.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Compat/MetadataUpdateHandlerAttribute.cs @@ -1,9 +1,8 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && WINDOWS_UWP -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif - +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY && WINDOWS_UWP using System.Diagnostics.CodeAnalysis; #nullable enable diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ColorExtensions.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ColorExtensions.cs index 8337a48..b26bcec 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ColorExtensions.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ColorExtensions.cs @@ -1,11 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable - +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Linq; using Windows.UI; diff --git a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ImageHelper.cs b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ImageHelper.cs index 418e526..46e0db6 100644 --- a/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ImageHelper.cs +++ b/src/Uno.UI.RuntimeTests.Engine.Library/Library/_Private/ImageHelper.cs @@ -1,10 +1,9 @@ -#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY -#nullable enable - -#if !IS_UNO_RUNTIMETEST_PROJECT +#if !IS_UNO_RUNTIMETEST_PROJECT #pragma warning disable #endif +#nullable enable +#if !UNO_RUNTIMETESTS_DISABLE_LIBRARY using System; using System.Linq; using Windows.UI;