-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow execution context across fixture methods when using timeout (#2843)
- Loading branch information
1 parent
4ca86ba
commit a0515c5
Showing
11 changed files
with
1,036 additions
and
42 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
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
14 changes: 14 additions & 0 deletions
14
src/Adapter/MSTestAdapter.PlatformServices/Services/AssemblyExecutionContextScope.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,14 @@ | ||
// 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.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; | ||
|
||
internal readonly struct AssemblyExecutionContextScope : IExecutionContextScope | ||
{ | ||
public AssemblyExecutionContextScope(bool isCleanup) | ||
{ | ||
IsCleanup = isCleanup; | ||
} | ||
|
||
public bool IsCleanup { get; } | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Adapter/MSTestAdapter.PlatformServices/Services/ClassExecutionContextScope.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,31 @@ | ||
// 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.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; | ||
|
||
internal readonly struct ClassExecutionContextScope : IExecutionContextScope | ||
{ | ||
public ClassExecutionContextScope(Type type) | ||
{ | ||
Type = type; | ||
IsCleanup = false; | ||
RemainingCleanupCount = 0; | ||
} | ||
|
||
public ClassExecutionContextScope(Type type, int remainingCleanupCount) | ||
{ | ||
Type = type; | ||
IsCleanup = true; | ||
RemainingCleanupCount = remainingCleanupCount; | ||
} | ||
|
||
public Type Type { get; } | ||
|
||
public bool IsCleanup { get; } | ||
|
||
public int RemainingCleanupCount { get; } | ||
|
||
public override readonly int GetHashCode() => Type.GetHashCode(); | ||
|
||
public override readonly bool Equals(object? obj) => Type.Equals(obj); | ||
} |
Oops, something went wrong.