Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MSTestParallelizeScope>MethodLevel</MSTestParallelizeScope>
Comment thread
Evangelink marked this conversation as resolved.
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
namespace Microsoft.TemplateEngine.Cli.UnitTests.PostActionTests
{
[TestClass]
// These tests mutate the process-global Microsoft.DotNet.Cli.Utils.Reporter.
[ResourceLock(nameof(Reporter))]
public class AddJsonPropertyPostActionTests
{
// MSTest has no IClassFixture equivalent; a lazily-initialized static helper
Expand All @@ -22,15 +24,23 @@ public class AddJsonPropertyPostActionTests
new(() => new EnvironmentSettingsHelper());

private IEngineEnvironmentSettings _engineEnvironmentSettings = null!;
private IReporter _originalErrorReporter = null!;

[TestInitialize]
public void TestInitialize()
{
_originalErrorReporter = Reporter.Error;
_engineEnvironmentSettings = s_environmentSettingsHelper.Value.CreateEnvironment(
hostIdentifier: GetType().Name,
virtualize: true);
}

[TestCleanup]
public void TestCleanup()
{
Reporter.SetError(_originalErrorReporter);
}

[ClassCleanup]
public static void ClassCleanup()
{
Expand Down
Loading