-
Notifications
You must be signed in to change notification settings - Fork 267
Closed
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality
Description
In the following unit-test, both normal C# methods are consistent with each other, while MockFileSystem's doesn'tL
[TestMethod]
public void TestPathNormalization() {
var mockFs = new MockFileSystem(new Dictionary<string, MockFileData>());
var vectors = new [] {
new {input = @"c:\top\..\most\file", expected = @"c:\most\file"},
new {input = @"c:\top\..\most\..\dir\file", expected = @"c:\dir\file"},
new {input = @"\file", expected = @"c:\file"}, // (assuming you're running on c:)
new {input = @"c:\top\../..\most\file", expected = @"c:\most\file"},
};
foreach (var vector in vectors) {
var path = Path.GetFullPath(vector.input);
var fileInfo = new FileInfo(vector.input).FullName;
var mock = mockFs.FileInfo.FromFileName(vector.input).FullName;
Assert.AreEqual(vector.expected, path, true);
Assert.AreEqual(vector.expected, fileInfo, true);
Assert.AreEqual(vector.expected, mock, true);
}
}
Metadata
Metadata
Assignees
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality