diff --git a/OmniSharp.Tests/AutoComplete/BugFixTests.cs b/OmniSharp.Tests/AutoComplete/BugFixTests.cs index dc1bfaa..a9e6ea5 100644 --- a/OmniSharp.Tests/AutoComplete/BugFixTests.cs +++ b/OmniSharp.Tests/AutoComplete/BugFixTests.cs @@ -112,5 +112,84 @@ public MyClass() } }").ShouldContain("String("); } + + [Test] + public void WhenOneSpace_ThenShouldCompleteWithProperty() + { + CompletionsFor( + @" + public class MyClass + { + public class Foo + { + public string Bar { get; set; } + } + + public MyClass() + { + var d = new Foo{ $ + } + }").ShouldContain("Bar"); + } + + [Test] + public void WhenNoSpace_ThenShouldCompleteWithProperty() + { + CompletionsFor( + @" + public class MyClass + { + public class Foo + { + public string Bar { get; set; } + } + + public MyClass() + { + var d = new Foo{$ + } + }").ShouldContain("Bar"); + } + + [Test] + public void WhenNewLine_ThenShouldCompleteWithProperty() + { + CompletionsFor( + @" + public class MyClass + { + public class Foo + { + public string Bar { get; set; } + } + + public MyClass() + { + var d = new Foo { + $ + } + }").ShouldContain("Bar"); + } + + [Test] + public void WhenNewLineCol1_ThenShouldCompleteWithProperty() + { + CompletionsFor( +@" +public class MyClass +{ + public class Foo + { + public string Bar { get; set; } + } + + public MyClass() + { + var d = new Foo { +$ + } +}" + ).ShouldContain("Bar"); + } } }