diff --git a/tests/Avalonia.Build.Tasks.UnitTest/Avalonia.Build.Tasks.UnitTest.csproj b/tests/Avalonia.Build.Tasks.UnitTest/Avalonia.Build.Tasks.UnitTest.csproj
index c6b95bb26c..f136e275c1 100644
--- a/tests/Avalonia.Build.Tasks.UnitTest/Avalonia.Build.Tasks.UnitTest.csproj
+++ b/tests/Avalonia.Build.Tasks.UnitTest/Avalonia.Build.Tasks.UnitTest.csproj
@@ -14,6 +14,7 @@
+
Always
diff --git a/tests/Avalonia.Build.Tasks.UnitTest/UnitTestBuildEngine.cs b/tests/Avalonia.Build.Tasks.UnitTest/UnitTestBuildEngine.cs
index 7dbbc7d02b..8e740a97f8 100644
--- a/tests/Avalonia.Build.Tasks.UnitTest/UnitTestBuildEngine.cs
+++ b/tests/Avalonia.Build.Tasks.UnitTest/UnitTestBuildEngine.cs
@@ -40,11 +40,11 @@ internal class UnitTestBuildEngine : IBuildEngine, IDisposable
public bool ContinueOnError { get; }
- public int LineNumberOfTaskNode { get; }
+ public int LineNumberOfTaskNode => 0;
- public int ColumnNumberOfTaskNode { get; }
+ public int ColumnNumberOfTaskNode => 0;
- public string ProjectFileOfTaskNode { get; }
+ public string ProjectFileOfTaskNode => string.Empty;
public IReadOnlyList Errors => _errors;
diff --git a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
index 7067b5aa45..3a65e21f38 100644
--- a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
+++ b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
@@ -25,4 +25,5 @@
+
diff --git a/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj b/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj
index 783630c1c0..47d3de264f 100644
--- a/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj
+++ b/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj
@@ -9,6 +9,7 @@
+
diff --git a/tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs b/tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs
index a82cdfa8b7..cc9ec89c4a 100644
--- a/tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs
+++ b/tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs
@@ -82,7 +82,7 @@ namespace Avalonia.DesignerSupport.Tests
var sessionId = Guid.NewGuid();
long handle = 0;
bool success = false;
- string error = null;
+ string? error = null;
var resultMessageReceivedToken = new CancellationTokenSource();
diff --git a/tests/Avalonia.DesignerSupport.Tests/Helpers.cs b/tests/Avalonia.DesignerSupport.Tests/Helpers.cs
index 223a86a9af..5edd990a07 100644
--- a/tests/Avalonia.DesignerSupport.Tests/Helpers.cs
+++ b/tests/Avalonia.DesignerSupport.Tests/Helpers.cs
@@ -1,15 +1,14 @@
using System;
using System.Collections;
-using System.Collections.Generic;
using System.Linq;
namespace Avalonia.DesignerSupport.Tests
{
static class Helpers
{
- public static void StructDiff(object parsed, object expected) => StructDiff(parsed, expected, "{root}");
+ public static void StructDiff(object? parsed, object? expected) => StructDiff(parsed, expected, "{root}");
- static void StructDiff(object parsed, object expected, string path)
+ static void StructDiff(object? parsed, object? expected, string path)
{
if (parsed == null && expected == null)
return;
@@ -17,7 +16,7 @@ namespace Avalonia.DesignerSupport.Tests
throw new Exception(
$"{path}: Null mismatch: {(parsed == null ? "null" : "not-null")} {(expected == null ? "null" : "not-null")}");
- if (parsed.GetType() != expected.GetType())
+ if (parsed!.GetType() != expected!.GetType())
throw new Exception($"{path}: Type mismatch: {parsed.GetType()} {expected.GetType()}");
if (parsed is string || parsed.GetType().IsPrimitive)
diff --git a/tests/Avalonia.DesignerSupport.Tests/RemoteProtocolTests.cs b/tests/Avalonia.DesignerSupport.Tests/RemoteProtocolTests.cs
index d5f8fa9030..92920d3417 100644
--- a/tests/Avalonia.DesignerSupport.Tests/RemoteProtocolTests.cs
+++ b/tests/Avalonia.DesignerSupport.Tests/RemoteProtocolTests.cs
@@ -21,27 +21,29 @@ namespace Avalonia.DesignerSupport.Tests
private const int TimeoutInMs = 1000;
private readonly List _disposables = new List();
- private IAvaloniaRemoteTransportConnection _server;
- private IAvaloniaRemoteTransportConnection _client;
+ private IAvaloniaRemoteTransportConnection? _server;
+ private IAvaloniaRemoteTransportConnection? _client;
private BlockingCollection