Skip to content

Commit 94f3fd4

Browse files
author
Kirill Orlov
committed
Added implementation for Create,CreateText and Open for MockFileInfo
1 parent b23859d commit 94f3fd4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

TestingHelpers/MockFileInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ public override FileInfoBase CopyTo(string destFileName, bool overwrite)
134134

135135
public override Stream Create()
136136
{
137-
throw new NotImplementedException("This test helper hasn't been implemented yet. They are implemented on an as-needed basis. As it seems like you need it, now would be a great time to send us a pull request over at https://github.com/tathamoddie/System.IO.Abstractions. You know, because it's open source and all.");
137+
return new MockFile(mockFileSystem).Create(FullName);
138138
}
139139

140140
public override StreamWriter CreateText()
141141
{
142-
throw new NotImplementedException("This test helper hasn't been implemented yet. They are implemented on an as-needed basis. As it seems like you need it, now would be a great time to send us a pull request over at https://github.com/tathamoddie/System.IO.Abstractions. You know, because it's open source and all.");
142+
return new MockFile(mockFileSystem).CreateText(FullName);
143143
}
144144

145145
public override void Decrypt()
@@ -170,17 +170,17 @@ public override void MoveTo(string destFileName)
170170

171171
public override Stream Open(FileMode mode)
172172
{
173-
throw new NotImplementedException("This test helper hasn't been implemented yet. They are implemented on an as-needed basis. As it seems like you need it, now would be a great time to send us a pull request over at https://github.com/tathamoddie/System.IO.Abstractions. You know, because it's open source and all.");
173+
return new MockFile(mockFileSystem).Open(FullName, mode);
174174
}
175175

176176
public override Stream Open(FileMode mode, FileAccess access)
177177
{
178-
throw new NotImplementedException("This test helper hasn't been implemented yet. They are implemented on an as-needed basis. As it seems like you need it, now would be a great time to send us a pull request over at https://github.com/tathamoddie/System.IO.Abstractions. You know, because it's open source and all.");
178+
return new MockFile(mockFileSystem).Open(FullName, mode, access);
179179
}
180180

181181
public override Stream Open(FileMode mode, FileAccess access, FileShare share)
182182
{
183-
throw new NotImplementedException("This test helper hasn't been implemented yet. They are implemented on an as-needed basis. As it seems like you need it, now would be a great time to send us a pull request over at https://github.com/tathamoddie/System.IO.Abstractions. You know, because it's open source and all.");
183+
return new MockFile(mockFileSystem).Open(FullName, mode, access, share);
184184
}
185185

186186
public override Stream OpenRead()

0 commit comments

Comments
 (0)