Skip to content

Commit 761c6e3

Browse files
PatrykOlejniczakfgreinacher
authored andcommitted
Unix support in unit tests move Path to use XFS.Path.
1 parent d1307d9 commit 761c6e3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

System.IO.Abstractions.TestingHelpers.Tests/MockFileCreateTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public void MockFile_Create_ShouldThrowDirectoryNotFoundExceptionIfCreatingAndPa
169169
public void MockFile_Create_TruncateShouldWriteNewContents()
170170
{
171171
// Arrange
172-
const string testFileName = @"c:\someFile.txt";
172+
string testFileName = XFS.Path(@"c:\someFile.txt");
173173
var fileSystem = new MockFileSystem();
174174

175175
using (var stream = fileSystem.FileStream.Create(testFileName, FileMode.Create, FileAccess.Write))
@@ -197,7 +197,7 @@ public void MockFile_Create_TruncateShouldWriteNewContents()
197197
public void MockFile_Create_TruncateShouldClearFileContentsOnOpen()
198198
{
199199
// Arrange
200-
const string testFileName = @"c:\someFile.txt";
200+
string testFileName = XFS.Path(@"c:\someFile.txt");
201201
var fileSystem = new MockFileSystem();
202202

203203
using (var stream = fileSystem.FileStream.Create(testFileName, FileMode.Create, FileAccess.Write))

System.IO.Abstractions.TestingHelpers.Tests/MockFileStreamFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void MockFileStreamFactory_CreateForNonExistingFile_ShouldReturnStream(Fi
3838
var fileStreamFactory = new MockFileStreamFactory(fileSystem);
3939

4040
// Act
41-
var result = fileStreamFactory.Create(@"c:\not_existing.txt", fileMode);
41+
var result = fileStreamFactory.Create(XFS.Path(@"c:\not_existing.txt"), fileMode);
4242

4343
// Assert
4444
Assert.IsNotNull(result);

System.IO.Abstractions.TestingHelpers.Tests/MockFileStreamTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void MockFileStream_Flush_WritesByteToFile()
1515
// Arrange
1616
var filepath = XFS.Path(@"C:\something\foo.txt");
1717
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>());
18-
fileSystem.AddDirectory(@"C:\something");
18+
fileSystem.AddDirectory(XFS.Path(@"C:\something"));
1919

2020
var cut = new MockFileStream(fileSystem, filepath, MockFileStream.StreamType.WRITE);
2121

0 commit comments

Comments
 (0)