forked from OmniSharp/csharp-language-server-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignatureHelpTests.cs
47 lines (41 loc) · 1.54 KB
/
SignatureHelpTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using FluentAssertions;
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
using Xunit;
namespace Lsp.Tests.Models
{
public class SignatureHelpTests
{
[Theory, JsonFixture]
public void SimpleTest(string expected)
{
var model = new SignatureHelp() {
ActiveParameter = 1,
ActiveSignature = 2,
Signatures = new[] { new SignatureInformation() {
Documentation = "ab",
Label = "ab",
Parameters = new[] { new ParameterInformation() {
Documentation = "param",
Label = "param"
} }
}
}
};
var result = Fixture.SerializeObject(model);
result.Should().Be(expected);
var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
deresult.Should().BeEquivalentTo(model);
}
[Theory, JsonFixture]
public void NoSignaturesTest(string expected)
{
var model = new SignatureHelp();
var result = Fixture.SerializeObject(model);
result.Should().Be(expected);
var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
deresult.Should().BeEquivalentTo(model);
}
}
}