From f0063c0ad23766703604b1767bbc7e7b362e9273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 10 Sep 2023 15:13:10 +0200 Subject: [PATCH 1/2] fix: nullable warning from SonarCloud --- .../FileSystem/DirectoryInfo/Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs index 90c270b7..32a0218e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs @@ -274,8 +274,8 @@ public void Parent_ArbitraryPaths_ShouldNotBeNull(string path1, sut.Parent.Should().NotBeNull(); sut.Parent!.Should().NotExist(); - sut.Parent.Parent.Should().NotBeNull(); - sut.Parent.Parent!.Should().NotExist(); + sut.Parent!.Parent.Should().NotBeNull(); + sut.Parent!.Parent!.Should().NotExist(); } [SkippableFact] From 9854dc1ea6360a6fb3279eebdcd4de722d76ef57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 10 Sep 2023 15:15:26 +0200 Subject: [PATCH 2/2] Replace ! with ? --- .../FileSystem/DirectoryInfo/Tests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs index 32a0218e..61b2d8ed 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs @@ -273,9 +273,9 @@ public void Parent_ArbitraryPaths_ShouldNotBeNull(string path1, IDirectoryInfo sut = FileSystem.DirectoryInfo.New(path); sut.Parent.Should().NotBeNull(); - sut.Parent!.Should().NotExist(); - sut.Parent!.Parent.Should().NotBeNull(); - sut.Parent!.Parent!.Should().NotExist(); + sut.Parent.Should().NotExist(); + sut.Parent?.Parent.Should().NotBeNull(); + sut.Parent?.Parent.Should().NotExist(); } [SkippableFact]