Skip to content

Commit

Permalink
added + fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw committed Dec 11, 2017
1 parent 9414727 commit e4f1578
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public void SomeMethod() {}
public async Task CanFindOverride(string filename)
{
const string code = @"
public class BaseClass { public abstract Some$$Method() {} }
public abstract class BaseClass { public abstract void Some$$Method(); }
public class SomeClass : BaseClass
{
public override SomeMethod() {}
public override void SomeMethod() {}
}";

var implementations = await FindImplementationsAsync(code, filename);
Expand Down
19 changes: 19 additions & 0 deletions tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,25 @@ public async Task Scripting_by_default_returns_completions_for_CSharp7_1()
ContainsCompletions(completions.Select(c => c.CompletionText), new[] { "number1", "number2" });
}

[Fact]
public async Task Scripting_by_default_returns_completions_for_CSharp7_2()
{
const string source =
@"
public class Foo { private protected int myValue = 0; }
public class Bar : Foo
{
public Bar()
{
var x = myv$$
}
}
";

var completions = await FindCompletionsAsync("dummy.csx", source);
ContainsCompletions(completions.Select(c => c.CompletionText), new[] { "myValue" });
}

private void ContainsCompletions(IEnumerable<string> completions, params string[] expected)
{
if (!completions.SequenceEqual(expected))
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Roslyn.CSharp.Tests/SignatureHelpFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task TestForParameterLabels()
public static void Main(){
Foo($$);
}
public static Foo(bool b, int n = 1234)
public static void Foo(bool b, int n = 1234)
{
}
}";
Expand Down

0 comments on commit e4f1578

Please sign in to comment.