Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed more warnings, converted to filebased namespaces
- Loading branch information
1 parent
6aec955
commit 7cd9aa1
Showing
118 changed files
with
9,482 additions
and
9,719 deletions.
There are no files selected for viewing
427 changes: 213 additions & 214 deletions
427
src/NUnit.TestAdapter.Tests.Acceptance/AcceptanceTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 9 additions & 10 deletions
19
src/NUnit.TestAdapter.Tests.Acceptance/AcceptanceTestsTeardownFixture.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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
using NUnit.Framework; | ||
|
||
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance | ||
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance; | ||
|
||
// https://github.com/nunit/nunit/issues/3166 | ||
[SetUpFixture] | ||
public sealed class AcceptanceTestsTeardownFixture | ||
{ | ||
// https://github.com/nunit/nunit/issues/3166 | ||
[SetUpFixture] | ||
public sealed class AcceptanceTestsTeardownFixture | ||
[OneTimeTearDown] | ||
public static void OneTimeTearDown() | ||
{ | ||
[OneTimeTearDown] | ||
public static void OneTimeTearDown() | ||
{ | ||
AcceptanceTests.OnGlobalTeardown(); | ||
} | ||
AcceptanceTests.OnGlobalTeardown(); | ||
} | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -1,37 +1,36 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance | ||
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance; | ||
|
||
public sealed class DirectoryMutex : IDisposable | ||
{ | ||
public sealed class DirectoryMutex : IDisposable | ||
private readonly FileStream mutexFile; | ||
|
||
public static DirectoryMutex TryAcquire(string directoryPath) | ||
{ | ||
private readonly FileStream mutexFile; | ||
var mutexFilePath = Path.Combine(directoryPath, ".mutex"); | ||
|
||
public static DirectoryMutex TryAcquire(string directoryPath) | ||
FileStream stream; | ||
try | ||
{ | ||
var mutexFilePath = Path.Combine(directoryPath, ".mutex"); | ||
|
||
FileStream stream; | ||
try | ||
{ | ||
stream = new FileStream(mutexFilePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 1, FileOptions.DeleteOnClose); | ||
} | ||
catch (IOException) // On Windows, (ushort)ex.HResult will be ERROR_SHARING_VIOLATION | ||
{ | ||
return null; | ||
} | ||
|
||
return new DirectoryMutex(stream, directoryPath); | ||
stream = new FileStream(mutexFilePath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 1, FileOptions.DeleteOnClose); | ||
} | ||
|
||
private DirectoryMutex(FileStream mutexFile, string directoryPath) | ||
catch (IOException) // On Windows, (ushort)ex.HResult will be ERROR_SHARING_VIOLATION | ||
{ | ||
this.mutexFile = mutexFile ?? throw new ArgumentNullException(nameof(mutexFile)); | ||
DirectoryPath = directoryPath ?? throw new ArgumentNullException(nameof(directoryPath)); | ||
return null; | ||
} | ||
|
||
public string DirectoryPath { get; } | ||
return new DirectoryMutex(stream, directoryPath); | ||
} | ||
|
||
public void Dispose() => mutexFile.Dispose(); | ||
private DirectoryMutex(FileStream mutexFile, string directoryPath) | ||
{ | ||
this.mutexFile = mutexFile ?? throw new ArgumentNullException(nameof(mutexFile)); | ||
DirectoryPath = directoryPath ?? throw new ArgumentNullException(nameof(directoryPath)); | ||
} | ||
} | ||
|
||
public string DirectoryPath { get; } | ||
|
||
public void Dispose() => mutexFile.Dispose(); | ||
} |
Oops, something went wrong.