diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs index 278042cb3..4199c5622 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs @@ -14,7 +14,7 @@ namespace System.IO.Abstractions.TestingHelpers public class MockFileSystem : FileSystemBase, IMockFileDataAccessor { private const string DEFAULT_CURRENT_DIRECTORY = @"C:\"; - private const string TEMP_DIRECTORY = @"C:\temp"; + private const string TEMP_DIRECTORY = @"C:\temp\"; private readonly IDictionary files; private readonly IDictionary drives; diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs index 3748705b0..d61c49f92 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs @@ -382,6 +382,20 @@ public void GetTempPath_Called_ReturnsStringLengthGreaterThanZero() Assert.That(result.Length > 0, Is.True); } + [Test] + public void GetTempPath_ShouldEndWithDirectorySeparator() + { + //Arrange + var mockPath = new MockFileSystem().Path; + var directorySeparator = mockPath.DirectorySeparatorChar.ToString(); + + //Act + var result = mockPath.GetTempPath(); + + //Assert + Assert.That(result, Does.EndWith(directorySeparator)); + } + [Test] [TestCase(null)] [TestCase("")]