Skip to content

Commit

Permalink
chore: Spacessssss (IDE0055)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Feb 13, 2024
1 parent 1a43cdd commit 8d00e91
Show file tree
Hide file tree
Showing 43 changed files with 143 additions and 180 deletions.
3 changes: 1 addition & 2 deletions src/TestApp/shared/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,7 +22,7 @@ public static LogScope Scope<T>(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
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
Expand Down Expand Up @@ -58,13 +58,13 @@ internal static partial class SecondaryApp
try
{
var results = await global::System.Text.Json.JsonSerializer.DeserializeAsync<TestCaseResult[]>(global::System.IO.File.OpenRead(resultFile), cancellationToken: ct);

return results ?? global::System.Array.Empty<TestCaseResult>();
}
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);
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/Uno.UI.RuntimeTests.Engine.Library/Engine/TestCase.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,7 +24,7 @@ public override string ToString()
{
var result = $"({string.Join(",", Parameters.Select(p => p?.ToString() ?? "<null>"))})";

if (Pointer is {} pt)
if (Pointer is { } pt)
{
result += $" [{pt}]";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if !IS_UNO_RUNTIMETEST_PROJECT
#pragma warning disable
# endif
#endif

using System;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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}.");
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -87,7 +87,7 @@ public static partial class AsyncAssert
/// <param name="timeoutMs">The max duration to wait for in milliseconds.</param>
/// <param name="ct">Cancellation token to cancel teh asynchronous operation</param>
public static global::System.Threading.Tasks.ValueTask IsTrue(global::System.Func<bool> 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);

/// <summary>
/// Asynchronously tests whether the specified condition is true and throws an exception if the condition is false.
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 8d00e91

Please sign in to comment.