Skip to content

Commit c9d5165

Browse files
committed
Fixed test runner and removed dependency on ResourceManagement scenario tests
1 parent 904aeff commit c9d5165

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/CLU/Commands.Common.ScenarioTest/ProcessHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,16 @@ private void SetEnvironmentVariables(ProcessStartInfo startInfo)
173173

174174
private void ProcessError(object sender, DataReceivedEventArgs e)
175175
{
176-
Logger.Instance.WriteError(e.Data);
176+
if (e.Data != null)
177+
{
178+
Logger.Instance.WriteError(e.Data);
179+
}
177180
}
178181

179182
private void ProcessOutput(object sender, DataReceivedEventArgs e)
180183
{
181-
Logger.Instance.WriteMessage(e.Data);
182184
_processOutput.Append(e.Data);
185+
Logger.Instance.WriteMessage(e.Data);
183186
}
184187

185188
private void EndProcess()

src/CLU/Commands.Common.ScenarioTest/ScenarioTestFixture.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using Microsoft.Azure.Commands.Common.Authentication.Models;
1717
using Microsoft.Azure.Commands.Common.ScenarioTest;
1818
using Microsoft.Azure.Commands.Models;
19-
using Moq.Protected;
2019
using Newtonsoft.Json;
2120

2221
namespace Microsoft.Azure.Commands.Common.ScenarioTest
@@ -34,6 +33,10 @@ public ScenarioTestFixture()
3433
var helper = GetRunner("lib");
3534
var profileText = helper.RunScript(credentials.LoginScriptName);
3635
var profile = JsonConvert.DeserializeObject<PSAzureProfile>(profileText);
36+
if (profile == null)
37+
{
38+
throw new ArgumentOutOfRangeException(nameof(profile), $"Deserialized profile is null: `{profileText}`");
39+
}
3740
AzureContext = (AzureContext) (profile.Context);
3841
}
3942

src/CLU/Commands.Common.ScenarioTest/project.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"Commands.Common": "",
2121
"Commands.Common.Authentication": "",
2222
"Commands.ResourceManager.Common": "",
23-
"Commands.ScenarioTests.ResourceManager.Common": "",
2423
"Microsoft.Azure.Commands.Profile": "",
2524
"Microsoft.Azure.Management.Resources": "3.3.0-preview",
2625
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",

0 commit comments

Comments
 (0)