Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnisharp VS Code Issue 1814 Fix #1007

Merged
merged 15 commits into from
Nov 9, 2017
Merged
32 changes: 29 additions & 3 deletions tests/OmniSharp.Roslyn.CSharp.Tests/SignatureHelpFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public MyTestAttribute(int value)
Assert.Equal("int value", signature.Parameters.ElementAt(0).Label);
}
[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line before method. Should be between close brace and [Fact]

public async Task SignatureHelpforAttributeCtorMultipleParam()
public async Task SignatureHelpforAttributeCtorTestParameterLabels()
{
const string source =
@"using System;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this pass? It doesn't look like there's a "$$" anywhere in the markup?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I see it. Anyway, it seems like the test is called "MultipleParam", but you're only testing in the first parameter position.

Expand Down Expand Up @@ -224,6 +224,32 @@ public MyTestAttribute(int value1,double value2)
Assert.Equal("value2", signature.Parameters.ElementAt(1).Name);
Assert.Equal("double value2", signature.Parameters.ElementAt(1).Label);
}
[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line before method. Should be between close brace and [Fact]

public async Task SignatureHelpforAttributeCtorActiveParamBasedOnComma()
{
const string source =
@"using System;
[MyTest(2,$$)]
public class TestClass
{
public static void Main()
{
}
}
public class MyTestAttribute : Attribute
{
int value1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, but you can remove the fields and their assignment, if you want to make the test code even simpler.

double value2;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can still be removed?

public MyTestAttribute(int value1,double value2)
{
this.value1 = value1;
this.value2 = value2;
}
}
";
var actual = await GetSignatureHelp(source);
Assert.Equal(1, actual.ActiveParameter);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary blank line

[Fact]
public async Task SignatureHelpforAttributeCtorNoParam()
Expand Down Expand Up @@ -422,7 +448,7 @@ private int Foo(string m, int n)
}

[Fact]
public async Task SigantureHelpForCtor()
public async Task SignatureHelpForCtor()
{
const string source =
@"class Program
Expand All @@ -447,7 +473,7 @@ public Program(Program p)
}

[Fact]
public async Task SigantureHelpForCtorWithOverloads()
public async Task SignatureHelpForCtorWithOverloads()
{
const string source =
@"class Program
Expand Down