From ae46296f171953a95a03167571d3e156346cd8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Fri, 27 Mar 2026 23:42:54 +0100 Subject: [PATCH 1/2] chore: update Mockolate to v2.0 --- Directory.Packages.props | 3 +- .../FileSystemTests.cs | 48 +++++++++---------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6695349ea..5f773bf65 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,13 +22,14 @@ - + + diff --git a/tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.cs b/tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.cs index 7a99d2086..d64616dea 100644 --- a/tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.Wrappers.Tests/FileSystemTests.cs @@ -26,88 +26,88 @@ await That(memoryStream).HasLength().GreaterThan(0) [Test] public async Task Mock_File_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.File.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.File.InitializeWith(IFile.CreateMock())); await That(() => - fileSystemMock.File.SetupMock.Method.ReadAllText(It.IsAny()).Returns("") + fileSystemMock.File.Mock.Setup.ReadAllText(It.IsAny()).Returns("") ).DoesNotThrow(); } [Test] public async Task Mock_Directory_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.Directory.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.Directory.InitializeWith(IDirectory.CreateMock())); await That(() => - fileSystemMock.Directory.SetupMock.Method.CreateDirectory(It.IsAny()) + fileSystemMock.Directory.Mock.Setup.CreateDirectory(It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_FileInfo_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.FileInfo.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.FileInfo.InitializeWith(IFileInfoFactory.CreateMock())); await That(() => - fileSystemMock.FileInfo.SetupMock.Method.New(It.IsAny()) + fileSystemMock.FileInfo.Mock.Setup.New(It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_FileStream_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.FileStream.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.FileStream.InitializeWith(IFileStreamFactory.CreateMock())); await That(() => - fileSystemMock.FileStream.SetupMock.Method.New(It.IsAny(), It.IsAny()) + fileSystemMock.FileStream.Mock.Setup.New(It.IsAny(), It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_Path_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.Path.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.Path.InitializeWith(IPath.CreateMock())); await That(() => - fileSystemMock.Path.SetupMock.Method.Combine(It.IsAny(), It.IsAny()) + fileSystemMock.Path.Mock.Setup.Combine(It.IsAny(), It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_DirectoryInfo_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.DirectoryInfo.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.DirectoryInfo.InitializeWith(IDirectoryInfoFactory.CreateMock())); await That(() => - fileSystemMock.DirectoryInfo.SetupMock.Method.New(It.IsAny()) + fileSystemMock.DirectoryInfo.Mock.Setup.New(It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_DriveInfo_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.DriveInfo.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.DriveInfo.InitializeWith(IDriveInfoFactory.CreateMock())); await That(() => - fileSystemMock.DriveInfo.SetupMock.Method.New(It.IsAny()) + fileSystemMock.DriveInfo.Mock.Setup.New(It.IsAny()) ).DoesNotThrow(); } [Test] public async Task Mock_FileSystemWatcher_Succeeds() { - var fileSystemMock = Mock.Create(fs => - fs.Property.FileSystemWatcher.InitializeWith(Mock.Create())); + var fileSystemMock = IFileSystem.CreateMock(fs => + fs.FileSystemWatcher.InitializeWith(IFileSystemWatcherFactory.CreateMock())); await That(() => - fileSystemMock.FileSystemWatcher.SetupMock.Method.New(It.IsAny()) + fileSystemMock.FileSystemWatcher.Mock.Setup.New(It.IsAny()) ).DoesNotThrow(); } } \ No newline at end of file From 1f06405c251cefd577f9cd95556462a4eaf322fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 28 Mar 2026 07:14:03 +0100 Subject: [PATCH 2/2] Fix review issue --- Directory.Packages.props | 1 - 1 file changed, 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5f773bf65..5a7ae39f4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -29,7 +29,6 @@ -