Skip to content

Commit 33c51f7

Browse files
committed
Move environment variable declaration to test constructor from controller
1 parent e7d65f3 commit 33c51f7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ResourceManager/Profile/Commands.Profile.Test/ContextCmdletTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
using Xunit;
2525
using Xunit.Abstractions;
2626
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
27+
using System;
28+
using Microsoft.WindowsAzure.Commands.Common;
2729

2830
namespace Microsoft.Azure.Commands.ResourceManager.Profile.Test
2931
{
@@ -42,6 +44,7 @@ public ContextCmdletTests(ITestOutputHelper output)
4244
AzureSession.Instance.DataStore = dataStore;
4345
commandRuntimeMock = new MockCommandRuntime();
4446
AzureSession.Instance.AuthenticationFactory = new MockTokenAuthenticationFactory();
47+
Environment.SetEnvironmentVariable(AzurePSDataCollectionProfile.EnvironmentVariableName, "false");
4548
}
4649

4750
[Fact]

src/ResourceManager/Profile/Commands.Profile.Test/ProfileController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void RunPsTestWorkflow(
108108
helper.RMResourceModule,
109109
helper.RMResourceManagerStartup,
110110
helper.RMInsightsModule);
111-
Environment.SetEnvironmentVariable(AzurePSDataCollectionProfile.EnvironmentVariableName, "false");
111+
112112
try
113113
{
114114
if (scriptBuilder != null)

0 commit comments

Comments
 (0)