Skip to content

Commit 53a8f08

Browse files
committed
Update test snapshots
1 parent 348897d commit 53a8f08

9 files changed

+22
-13
lines changed

test/Dap.Tests/FoundationTests.cs

+10-8
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void HandlersShouldMatchParamsMethodAttribute(Type type)
140140
lhs.Direction.Should().Be(rhs.Direction, $"{type.FullName} direction does not match {paramsType.FullName}");
141141
}
142142

143-
[Theory(DisplayName = "Handler interfaces should have a abstract class")]
143+
[Theory(DisplayName = "Handler interfaces should have an abstract class")]
144144
[ClassData(typeof(TypeHandlerData))]
145145
public void HandlersShouldAbstractClass(IHandlerTypeDescriptor descriptor)
146146
{
@@ -226,17 +226,19 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection(
226226
.Distinct()
227227
.ToHashSet();
228228

229-
var expectedEventRegistries = descriptor.Direction switch {
230-
Direction.ClientToServer => new (string type, Func<ParameterInfo, bool> matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ) },
231-
Direction.ServerToClient => new (string type, Func<ParameterInfo, bool> matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) },
229+
var expectedEventRegistries = descriptor.Direction switch
230+
{
231+
Direction.ClientToServer => new (string type, Func<ParameterInfo, bool> matcher)[] { ("Server", info => info.ParameterType.Name.EndsWith("ServerRegistry")) },
232+
Direction.ServerToClient => new (string type, Func<ParameterInfo, bool> matcher)[] { ("Client", info => info.ParameterType.Name.EndsWith("ClientRegistry")) },
232233
Direction.Bidirectional => new (string type, Func<ParameterInfo, bool> matcher)[]
233234
{ ( "Server", info => info.ParameterType.Name.EndsWith("ServerRegistry") ), ( "Client", info => info.ParameterType.Name.EndsWith("ClientRegistry") ) },
234235
_ => throw new NotImplementedException(descriptor.HandlerType.FullName)
235236
};
236237

237-
var expectedRequestHandlers = descriptor.Direction switch {
238-
Direction.ClientToServer => new (string type, Func<ParameterInfo, bool> matcher)[] { ( "Server", info => info.ParameterType.Name.EndsWith("Client") ) },
239-
Direction.ServerToClient => new (string type, Func<ParameterInfo, bool> matcher)[] { ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) },
238+
var expectedRequestHandlers = descriptor.Direction switch
239+
{
240+
Direction.ClientToServer => new (string type, Func<ParameterInfo, bool> matcher)[] { ("Server", info => info.ParameterType.Name.EndsWith("Client")) },
241+
Direction.ServerToClient => new (string type, Func<ParameterInfo, bool> matcher)[] { ("Client", info => info.ParameterType.Name.EndsWith("Server")) },
240242
Direction.Bidirectional => new (string type, Func<ParameterInfo, bool> matcher)[]
241243
{ ( "Server", info => info.ParameterType.Name.EndsWith("Client") ), ( "Client", info => info.ParameterType.Name.EndsWith("Server") ) },
242244
_ => throw new NotImplementedException(descriptor.HandlerType.FullName)
@@ -526,7 +528,7 @@ private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor)
526528
{
527529
var name = GetExtensionClassName(descriptor);
528530
return descriptor.HandlerType.Assembly.GetExportedTypes()
529-
.FirstOrDefault(z => z.IsClass && z.IsAbstract && ( z.Name == name || z.Name == name + "Base" ));
531+
.FirstOrDefault(z => z.IsClass && z.IsAbstract && (z.Name == name || z.Name == name + "Base"));
530532
}
531533

532534
private static string GetOnMethodName(IHandlerTypeDescriptor descriptor) => "On" + SpecialCasedHandlerName(descriptor);

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.00AssemblyCapabilityKeys.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//HintName: AssemblyCapabilityKeys.cs
22
using MediatR;
3+
using Newtonsoft.Json.Linq;
34
using OmniSharp.Extensions.JsonRpc;
45
using OmniSharp.Extensions.JsonRpc.Generation;
56
using OmniSharp.Extensions.LanguageServer.Protocol;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.01Test0_SymbolInformationParams.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#nullable enable
33
using System.Diagnostics;
44
using MediatR;
5+
using Newtonsoft.Json.Linq;
56
using OmniSharp.Extensions.JsonRpc;
67
using OmniSharp.Extensions.JsonRpc.Generation;
78
using OmniSharp.Extensions.LanguageServer.Protocol.Client;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.02Test0_WorkspaceSymbolParams.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#nullable enable
33
using System.Diagnostics;
44
using MediatR;
5+
using Newtonsoft.Json.Linq;
56
using OmniSharp.Extensions.JsonRpc;
67
using OmniSharp.Extensions.JsonRpc.Generation;
78
using OmniSharp.Extensions.LanguageServer.Protocol.Client;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.04SymbolInformationParams.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//HintName: SymbolInformationParams.cs
22
using MediatR;
33
using Microsoft.Extensions.DependencyInjection;
4+
using Newtonsoft.Json.Linq;
45
using OmniSharp.Extensions.DebugAdapter.Protocol;
56
using OmniSharp.Extensions.DebugAdapter.Protocol.Events;
67
using OmniSharp.Extensions.DebugAdapter.Protocol.Models;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.05WorkspaceSymbol.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//HintName: WorkspaceSymbol.cs
22
using MediatR;
33
using Microsoft.Extensions.DependencyInjection;
4+
using Newtonsoft.Json.Linq;
45
using OmniSharp.Extensions.DebugAdapter.Protocol;
56
using OmniSharp.Extensions.DebugAdapter.Protocol.Events;
67
using OmniSharp.Extensions.DebugAdapter.Protocol.Models;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.06WorkspaceSymbolParams.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//HintName: WorkspaceSymbolParams.cs
22
using MediatR;
33
using Microsoft.Extensions.DependencyInjection;
4+
using Newtonsoft.Json.Linq;
45
using OmniSharp.Extensions.DebugAdapter.Protocol;
56
using OmniSharp.Extensions.DebugAdapter.Protocol.Events;
67
using OmniSharp.Extensions.DebugAdapter.Protocol.Models;

test/Generation.Tests/snapshots/LspFeatureTests.Supports_Params_Type_As_Source.08WorkspaceSymbolRegistrationOptions.verified.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//HintName: WorkspaceSymbolRegistrationOptions.cs
22
using System.Diagnostics;
33
using MediatR;
4+
using Newtonsoft.Json.Linq;
45
using OmniSharp.Extensions.JsonRpc;
56
using OmniSharp.Extensions.JsonRpc.Generation;
67
using OmniSharp.Extensions.LanguageServer.Protocol.Client;

test/Lsp.Tests/FoundationTests.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void Debugger_Display_Should_Not_Throw(Type type)
142142
{
143143
var instance = Activator.CreateInstance(type);
144144
var property = type.GetProperty("DebuggerDisplay", BindingFlags.NonPublic | BindingFlags.Instance)!;
145-
var a1 = () => ( property.GetValue(instance) as string )!;
145+
var a1 = () => (property.GetValue(instance) as string)!;
146146
var a2 = () => instance!.ToString()!;
147147

148148
a1.Should().NotThrow().And.NotBeNull();
@@ -205,7 +205,7 @@ public void Registration_Converters_Should_Have_THe_Same_Properties(Type type)
205205
source.Should().Contain(destination);
206206
}
207207

208-
[Theory(DisplayName = "Handler interfaces should have a abstract class")]
208+
[Theory(DisplayName = "Handler interfaces should have an class")]
209209
[ClassData(typeof(TypeHandlerData))]
210210
public void HandlersShouldAbstractClass(ILspHandlerTypeDescriptor descriptor)
211211
{
@@ -392,7 +392,7 @@ Func<MethodInfo, bool> ForAnyParameter(Func<ParameterInfo, bool> m)
392392
var returns = ForAnyParameter(info => info.ParameterType.GetGenericArguments().LastOrDefault() == returnType);
393393
var isAction = ForAnyParameter(info => info.ParameterType.Name.StartsWith(nameof(Action)));
394394
var isFunc = ForAnyParameter(info => info.ParameterType.Name.StartsWith("Func"));
395-
395+
396396
var takesParameter = ForAnyParameter(info => info.ParameterType.GetGenericArguments().FirstOrDefault() == descriptor.ParamsType);
397397
var takesCapability = ForAnyParameter(info => info.ParameterType.GetGenericArguments().Skip(1).FirstOrDefault() == descriptor.CapabilityType);
398398

@@ -772,7 +772,7 @@ public TypeHandlerExtensionData()
772772
foreach (var type in typeof(CompletionParams).Assembly.ExportedTypes
773773
.Where(z => z.IsInterface && typeof(IJsonRpcHandler).IsAssignableFrom(z))
774774
.Where(z => !z.Name.EndsWith("Manager"))
775-
.Except(new[] { typeof(ITextDocumentSyncHandler) , typeof(INotebookDocumentSyncHandler)})
775+
.Except(new[] { typeof(ITextDocumentSyncHandler), typeof(INotebookDocumentSyncHandler) })
776776
)
777777
{
778778
if (type.IsGenericTypeDefinition && !MethodAttribute.AllFrom(type).Any()) continue;
@@ -818,7 +818,7 @@ private static Type GetExtensionClass(IHandlerTypeDescriptor descriptor)
818818
{
819819
var name = GetExtensionClassName(descriptor);
820820
return descriptor.HandlerType.Assembly.GetExportedTypes()
821-
.FirstOrDefault(z => z.IsClass && z.IsAbstract && ( z.Name == name || z.Name == name + "Base" ))!;
821+
.FirstOrDefault(z => z.IsClass && z.IsAbstract && (z.Name == name || z.Name == name + "Base"))!;
822822
}
823823

824824
private static string GetOnMethodName(IHandlerTypeDescriptor descriptor)

0 commit comments

Comments
 (0)