Skip to content

Commit 1b362fb

Browse files
committed
Clean up tests in DebugServiceTests.cs
1 parent 8522e0f commit 1b362fb

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ indent_size = 4
1212
trim_trailing_whitespace = true
1313
csharp_space_before_open_square_brackets = true
1414
csharp_space_after_keywords_in_control_flow_statements = true
15+
csharp_space_before_open_square_brackets = false
1516

1617
# CS0168: The variable 'var' is declared but never used
1718
dotnet_diagnostic.CS0168.severity = error

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,7 @@ public async Task CanStepPastSystemWindowsForms()
260260
new SetFunctionBreakpointsArguments
261261
{
262262
Breakpoints = new FunctionBreakpoint[]
263-
{
264-
new FunctionBreakpoint
265-
{
266-
Name = "Write-Host",
267-
}
268-
}
263+
{ new FunctionBreakpoint { Name = "Write-Host", } }
269264
}).ConfigureAwait(false);
270265

271266
var breakpoint = setBreakpointsResponse.Breakpoints.First();

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ await this.debugService.SetCommandBreakpointsAsync(
114114
await executeTask.ConfigureAwait(false);
115115

116116
StackFrameDetails[] stackFrames = debugService.GetStackFrames();
117-
Assert.Equal(StackFrameDetails.NoFileScriptPath, stackFrames [0].ScriptPath);
117+
Assert.Equal(StackFrameDetails.NoFileScriptPath, stackFrames[0].ScriptPath);
118118

119119
VariableDetailsBase[] variables =
120120
debugService.GetVariables(stackFrames[0].LocalVariables.Id);
@@ -151,7 +151,7 @@ public async Task DebuggerAcceptsScriptArgs(string[] args)
151151

152152
await this.debugService.SetLineBreakpointsAsync(
153153
debugWithParamsFile,
154-
new [] { BreakpointDetails.Create(debugWithParamsFile.FilePath, 3) }).ConfigureAwait(false);
154+
new[] { BreakpointDetails.Create(debugWithParamsFile.FilePath, 3) }).ConfigureAwait(false);
155155

156156
string arguments = string.Join(" ", args);
157157

@@ -580,8 +580,6 @@ await this.AssertStateChange(
580580
PowerShellContextState.Ready,
581581
PowerShellExecutionResult.Stopped).ConfigureAwait(false);
582582

583-
// Abort script execution early and wait for completion
584-
this.debugService.Abort();
585583
await executeTask.ConfigureAwait(false);
586584
}
587585

@@ -872,7 +870,7 @@ await this.debugService.SetLineBreakpointsAsync(
872870
Assert.Equal("[1]", childVars[1].Name);
873871

874872
var childVarStrs = new HashSet<string>(childVars.Select(v => v.ValueString));
875-
var expectedVars = new [] {
873+
var expectedVars = new[] {
876874
"[firstChild, \"Child\"]",
877875
"[secondChild, 42]"
878876
};
@@ -1026,15 +1024,15 @@ await this.debugService.SetLineBreakpointsAsync(
10261024
await executeTask.ConfigureAwait(false);
10271025
}
10281026

1029-
public async Task AssertDebuggerPaused()
1027+
private async Task AssertDebuggerPaused()
10301028
{
10311029
DebuggerStoppedEventArgs eventArgs =
10321030
await this.debuggerStoppedQueue.DequeueAsync(new CancellationTokenSource(10000).Token).ConfigureAwait(false);
10331031

10341032
Assert.Empty(eventArgs.OriginalEvent.Breakpoints);
10351033
}
10361034

1037-
public async Task AssertDebuggerStopped(
1035+
private async Task AssertDebuggerStopped(
10381036
string scriptPath,
10391037
int lineNumber = -1)
10401038
{

0 commit comments

Comments
 (0)