Skip to content

Commit 599047c

Browse files
incorporated review comments.
1 parent a0a306d commit 599047c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Agent.Listener/Configuration/ConfigurationManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
using Microsoft.VisualStudio.Services.Agent.Util;
33
using Microsoft.VisualStudio.Services.Client;
44
using Microsoft.VisualStudio.Services.Common;
5-
using Microsoft.VisualStudio.Services.WebApi;
65

76
using System;
87
using System.Collections.Generic;
8+
using System.Threading;
99
using System.Linq;
1010
using System.Threading.Tasks;
1111

@@ -223,7 +223,7 @@ public async Task ConfigureAsync(Dictionary<string, string> args, HashSet<string
223223
agentName = consoleWizard.ReadValue(CliArgs.Agent,
224224
StringUtil.Loc("AgentName"),
225225
false,
226-
Environment.MachineName,
226+
Environment.MachineName ?? "myagent",
227227
// can do better
228228
Validators.NonEmptyValidator,
229229
args,

src/Test/L0/Listener/AgentL0.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ public async void TestRunAsync()
190190
[Trait("Category", "Agent")]
191191
public async void TestExecuteCommandForRunAsService(string[] args, bool configureAsService, Times expectedTimes)
192192
{
193-
using (var thc = new TestHostContext(this))
193+
using (var hc = new TestHostContext(this))
194194
{
195-
thc.SetSingleton<IConfigurationManager>(_configurationManager.Object);
196-
thc.SetSingleton<IMessageListener>(_messageListener.Object);
195+
hc.SetSingleton<IConfigurationManager>(_configurationManager.Object);
196+
hc.SetSingleton<IMessageListener>(_messageListener.Object);
197197

198-
CommandLineParser clp = new CommandLineParser(thc);
198+
CommandLineParser clp = new CommandLineParser(hc);
199199
clp.Parse(args);
200200

201201
_configurationManager.Setup(x => x.IsConfigured()).Returns(true);
@@ -205,7 +205,7 @@ public async void TestExecuteCommandForRunAsService(string[] args, bool configur
205205
.Returns(Task.FromResult(false));
206206

207207
var agent = new Agent.Listener.Agent();
208-
agent.Initialize(thc);
208+
agent.Initialize(hc);
209209
agent.TokenSource = new CancellationTokenSource();
210210
await agent.ExecuteCommand(clp);
211211

0 commit comments

Comments
 (0)