Comments (3)
Can we get a unit test that doesnt have so much specificity? The paths you
have there are very specific, since you're testing for case, just create a
unit test where the directory name is C:\CaseSensitiveTest (for example).
On Wed, Jul 8, 2015 at 7:33 AM, Boris Modylevsky [email protected]
wrote:
Here is a unit test that reproduces the issue.
`
[Test]
public void
Move_DirectoryExistsWithDifferentCase_DirectorySuccessfullyMoved()
{
// Arrange
var fileSystem = new MockFileSystem();
fileSystem.AddDirectory(@"\builds\Builds\Suites\6.2.3.309 [6.2.3
135907]\TestShellHotFix\Data"); // HotFix with capital F
fileSystem.AddFile( @"\builds\Builds\Suites\6.2.3.309 [6.2.3
135907]\TestShellHotfix\Data\Content\DriverBuilder\ActiproSoftware.Navigation.Wpf.dll",
new MockFileData("abc"));// Act fileSystem.Directory.Move(@"\\builds\Builds\Suites\6.2.3.309 [6.2.3 135907]\TestShellHotfix", // HotFix with lower f @"\\builds\Builds\Suites\6.2.3.309 [6.2.3 135907]\Hotfix1 for CloudShell 6.2.3 GA [6.2.3.187]"); // Assert Assert.IsTrue( fileSystem.File.Exists(@"\\builds\Builds\Suites\6.2.3.309 [6.2.3 135907]\Hotfix1 for CloudShell 6.2.3 GA [6.2.3.187]\Data\Content\DriverBuilder\ActiproSoftware.Navigation.Wpf.dll")); }
`
—
Reply to this email directly or view it on GitHub
#134.
from system.io.abstractions.
@ericnewton76 Test was changed to be less specific. Can you review and accept the PR?
Thanks!
from system.io.abstractions.
Fixed by #135
from system.io.abstractions.
Related Issues (20)
- Async options for all actions HOT 1
- IFile.Open(Read) cannot be mocked with NSubstitute anymore due to System.IO.Abstractions.FileSystemStream HOT 8
- MockFileSystem: IFile.GetLastWriteTimeUtc may return wrong last write time after calling IFileInfo.Open HOT 2
- BinaryFormatter becomes obsolete -> Remove it with .NET 8.0 HOT 2
- MockPath.GetFullPath does not match windows behavior. HOT 4
- IDirectoryInfoFactory.Wrap loses part of absolute path when used with MockFileSystem HOT 4
- PathVerifier fails on whitespace filename under Linux and .NET Core HOT 1
- Creating new MockFileInfo thinks file exists when it actually does not. HOT 3
- Microsoft Fakes does not generate Fakes namespace for System.IO.Abstractions interfaces HOT 1
- I want to step out of this project HOT 13
- Providing mocks as and when necessary HOT 4
- Allow selection of os dependent FS semantics HOT 3
- Multiple temp directories in MockFileSystem HOT 4
- [Test] public void MockFileInfo_Exists_LazyLoadsData() { // Arrange var fileSystem = new MockFileSystem(); var path1 = XFS.Path(@"c:\temp\file1.txt"); var fileInfo = fileSystem.FileInfo.FromFileName(path1); var otherFileInfo = fileSystem.FileInfo.FromFileName(path1); loadedFileInfo.Exists; // this forces a lazyload of the data. // Act fileSystem.AddFile(path1, new MockFileData("1")); // Assert Assert.IsTrue(fileInfo.Exists); Assert.IsFalse(loadedFileInfo.Exists); } HOT 1
- FileStreamWrapper breaks patternmatching type testing HOT 5
- MockFileSystem.Directory.CreateDirectory should throw IOException if conflicting file exists HOT 2
- Signature missing in the dll HOT 8
- FileInfoFactory and DirectoryInfoFactory Wrap implementations don't match the interface for nullability HOT 2
- IFileSystemInfo.ResolveLinkTarget throws exception instead of returning null if the path is not a link HOT 3
- Creation of the default "temp" directory in MockFileSystem should have a toggle HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from system.io.abstractions.