string Test(string input, string type, string member, Gdk.Key key = Gdk.Key.Return)
        {
            TestViewContent content;
            var ext = Setup (input, out content);

            ListWindow.ClearHistory ();
            var listWindow = new CompletionListWindow ();
            var widget = new TestCompletionWidget (ext.Document);
            listWindow.CompletionWidget = widget;
            listWindow.CodeCompletionContext = widget.CurrentCodeCompletionContext;
            var t = ext.Document.Compilation.FindType (new FullTypeName (type));
            var foundMember = t.GetMembers (m => m.Name == member).First ();
            var data = new MemberCompletionData (ext, foundMember, OutputFlags.ClassBrowserEntries);
            data.DisplayFlags |= ICSharpCode.NRefactory.Completion.DisplayFlags.NamedArgument;
            KeyActions ka = KeyActions.Process;
            data.InsertCompletionText (listWindow, ref ka, key, (char)key, Gdk.ModifierType.None, true, false);
            return widget.CompletedWord;
        }
        string Test(string input, string type, string member, Gdk.Key key = Gdk.Key.Return, bool isDelegateExpected = false)
        {
            TestViewContent content;
            var ext = Setup (input, out content);

            ListWindow.ClearHistory ();
            var listWindow = new CompletionListWindow ();
            var widget = new TestCompletionWidget (ext.Document);
            listWindow.CompletionWidget = widget;
            listWindow.CodeCompletionContext = widget.CurrentCodeCompletionContext;

            var t = ext.Document.Compilation.FindType (new FullTypeName (type));
            var method = member != null ? t.GetMembers (m => m.Name == member).First () : t.GetConstructors ().First ();
            var data = new MemberCompletionData (ext, method, OutputFlags.ClassBrowserEntries);
            data.IsDelegateExpected = isDelegateExpected;
            KeyActions ka = KeyActions.Process;
            data.InsertCompletionText (listWindow, ref ka, key, (char)key, Gdk.ModifierType.None, true, false);
            return widget.CompletedWord;
        }