public void AddingSnippetToTextEditShouldThrow()
        {
            Action fail = () => CompletionItemBuilder.Create(CompletionItemKind.Class, "label")
                          .WithSnippetEdit(new Range(), "s")
                          .WithSnippet("s2");

            fail.Should().Throw <InvalidOperationException>().WithMessage("Unable to set the specified insert text because a text edit is already set.");
        }
        public void AddingPlainTextEditToInsertTextShouldThrow()
        {
            Action fail = () => CompletionItemBuilder.Create(CompletionItemKind.Class, "label")
                          .WithInsertText("t")
                          .WithPlainTextEdit(new Range(), "t2");

            fail.Should().Throw <InvalidOperationException>().WithMessage("Unable to set the text edit because the insert text is already set.");
        }
        public void PlainTextCompletionItemTextEditTextShouldNotContainCarriageReturnCharacter()
        {
            var text = "module testModule 'main.bicep' = {\r\n  name: 'myModule'\r\n  }";
            var completionItemBuilder = CompletionItemBuilder.Create(CompletionItemKind.Text, "label")
                                        .WithPlainTextEdit(new Range(), text);
            string completionItemTextEditText = completionItemBuilder.Build().TextEdit !.TextEdit !.NewText;

            completionItemTextEditText.Should().Be("module testModule 'main.bicep' = {\n  name: 'myModule'\n  }");
        }