-
Notifications
You must be signed in to change notification settings - Fork 267
Closed
Labels
state: in workIssues that are currently worked onIssues that are currently worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality
Description
The following two unit tests fail:
[TestInitialize]
public void TestInit() {
var desktopPath = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\Desktop");
var tempDirPath = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Local\Temp");
IFileSystem mock = new System.IO.Abstractions.TestingHelpers.MockFileSystem(
new Dictionary<string, MockFileData>(/*StringComparer.OrdinalIgnoreCase*/) {
[desktopPath] = new MockDirectoryData()
});
IFileSystem real = new System.IO.Abstractions.FileSystem();
real.Directory.SetCurrentDirectory(tempDirPath);
mock.Directory.SetCurrentDirectory(tempDirPath);
_realFileName = real.DirectoryInfo.FromDirectoryName(@"..\..\..\Desktop");
_mockFileName = mock.DirectoryInfo.FromDirectoryName(@"..\..\..\Desktop");
}
[TestMethod]
public void Test_ExistsProperty() {
Assert.IsTrue(_realFileName.Exists); // Passed.
Assert.IsTrue(_mockFileName.Exists); // Failed!
}
[TestMethod]
public void Test_ToStringMethod() {
Assert.AreEqual(@"..\..\..\Desktop", _realFileName.ToString()); // Passed.
Assert.AreEqual(@"..\..\..\Desktop", _mockFileName.ToString()); // Failed!
// mockFileName.ToString() emits: @"C:\Users\USERNAME\AppData\Desktop"
}
Metadata
Metadata
Assignees
Labels
state: in workIssues that are currently worked onIssues that are currently worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality