Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: tathamoddie/System.IO.Abstractions
base: f5d59f8651
...
head fork: tathamoddie/System.IO.Abstractions
compare: 1c7e351c4a
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
34 TestHelpers.Tests/MockFileTests.cs
@@ -471,10 +471,10 @@ public void MockFile_Move_ShouldMoveFileWithinMemoryFileSystem()
{
const string sourceFilePath = @"c:\something\demo.txt";
const string sourceFileContent = "this is some content";
- var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()
- {
- {sourceFilePath, new MockFileData(sourceFileContent)}
- });
+ var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
+ {
+ {sourceFilePath, new MockFileData(sourceFileContent)}
+ });
const string destFilePath = @"c:\somethingelse\demo1.txt";
@@ -506,10 +506,10 @@ public void MockFile_OpenWrite_ShouldOverwriteExistingFiles()
const string filePath = @"c:\something\demo.txt";
const string startFileContent = "this is some content";
const string endFileContent = "this is some other content";
- var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()
- {
- {filePath, new MockFileData(startFileContent)}
- });
+ var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
+ {
+ {filePath, new MockFileData(startFileContent)}
+ });
var bytes = new UTF8Encoding(true).GetBytes(endFileContent);
var stream = fileSystem.File.OpenWrite(filePath);
@@ -523,9 +523,9 @@ public void MockFile_OpenWrite_ShouldOverwriteExistingFiles()
[Test]
public void MockFile_Copy_ShouldOverwriteFileWhenOverwriteFlagIsTrue()
{
- string sourceFileName = @"c:\source\demo.txt";
- MockFileData sourceContents = new MockFileData("Source content");
- string destFileName = @"c:\destination\demo.txt";
+ const string sourceFileName = @"c:\source\demo.txt";
+ var sourceContents = new MockFileData("Source content");
+ const string destFileName = @"c:\destination\demo.txt";
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{sourceFileName, sourceContents},
@@ -541,9 +541,9 @@ public void MockFile_Copy_ShouldOverwriteFileWhenOverwriteFlagIsTrue()
[Test]
public void MockFile_Copy_ShouldCreateFileAtNewDestination()
{
- string sourceFileName = @"c:\source\demo.txt";
- MockFileData sourceContents = new MockFileData("Source content");
- string destFileName = @"c:\destination\demo.txt";
+ const string sourceFileName = @"c:\source\demo.txt";
+ var sourceContents = new MockFileData("Source content");
+ const string destFileName = @"c:\destination\demo.txt";
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{sourceFileName, sourceContents}
@@ -558,9 +558,9 @@ public void MockFile_Copy_ShouldCreateFileAtNewDestination()
[Test]
public void MockFile_Copy_ShouldThrowExceptionWhenFileExistsAtDestination()
{
- string sourceFileName = @"c:\source\demo.txt";
- MockFileData sourceContents = new MockFileData("Source content");
- string destFileName = @"c:\destination\demo.txt";
+ const string sourceFileName = @"c:\source\demo.txt";
+ var sourceContents = new MockFileData("Source content");
+ const string destFileName = @"c:\destination\demo.txt";
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{sourceFileName, sourceContents},
View
10 TestingHelpers/MockDirectoryData.cs
@@ -0,0 +1,10 @@
+namespace System.IO.Abstractions.TestingHelpers
+{
+ [Serializable]
+ public class MockDirectoryData : MockFileData {
+ public override bool IsDirectory { get { return true; } }
+
+ public MockDirectoryData() : base(string.Empty) {
+ }
+ }
+}
View
8 TestingHelpers/MockFileData.cs
@@ -67,12 +67,4 @@ public FileAttributes Attributes
set { attributes = value; }
}
}
-
- [Serializable]
- public class MockDirectoryData : MockFileData {
- public override bool IsDirectory { get { return true; } }
-
- public MockDirectoryData() : base(string.Empty) {
- }
- }
}
View
1  TestingHelpers/TestingHelpers.csproj
@@ -75,6 +75,7 @@
<ItemGroup>
<Compile Include="IMockFileDataAccessor.cs" />
<Compile Include="MockDirectory.cs" />
+ <Compile Include="MockDirectoryData.cs" />
<Compile Include="MockDirectoryInfo.cs" />
<Compile Include="MockDirectoryInfoFactory.cs" />
<Compile Include="MockFile.cs" />

No commit comments for this range

Something went wrong with that request. Please try again.