-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove not required FileShare option
- Loading branch information
Showing
2 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Helpers/FileHelperTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.TestPlatform.CoreUtilities.UnitTests.Helpers | ||
{ | ||
using System.IO; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using VisualStudio.TestPlatform.Utilities.Helpers; | ||
|
||
[TestClass] | ||
public class FileHelperTests | ||
{ | ||
private readonly FileHelper fileHelper; | ||
private readonly string tempFile; | ||
|
||
public FileHelperTests() | ||
{ | ||
this.tempFile = Path.GetTempFileName(); | ||
File.AppendAllText(this.tempFile, "Some content.."); | ||
this.fileHelper = new FileHelper(); | ||
} | ||
|
||
[TestCleanup] | ||
public void Cleanup() | ||
{ | ||
File.Delete(this.tempFile); | ||
} | ||
|
||
[TestMethod] | ||
public void GetStreamShouldAbleToGetTwoStreamSimultanouslyIfFileAccessIsRead() | ||
{ | ||
using (var stream1 = this.fileHelper.GetStream(this.tempFile, FileMode.Open, FileAccess.Read)) | ||
{ | ||
using (var stream2 = | ||
this.fileHelper.GetStream(this.tempFile, FileMode.Open, FileAccess.Read)) | ||
{ | ||
} | ||
} | ||
} | ||
} | ||
} |