public void GetOrCreateVimBufferForHost_Disallow() { VimHost.ShouldCreateVimBufferImpl = false; var textView = CreateTextView(""); Assert.False(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer)); }
public void GetOrCreateVimBufferForHost_Simple() { VimHost.ShouldCreateVimBufferImpl = true; var textView = CreateTextView(""); Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer)); Assert.NotNull(vimBuffer); }
public void GetOrCreateVimBufferForHost_AlreadyCreated() { VimHost.ShouldCreateVimBufferImpl = false; var textView = CreateTextView(""); Vim.CreateVimBuffer(textView); Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer)); Assert.NotNull(vimBuffer); }
public void GetOrCreateVimBufferForHost_VimTextBufferAlreadyCreated() { VimHost.ShouldCreateVimBufferImpl = true; var textView = CreateTextView(""); var vimTextBuffer = Vim.GetOrCreateVimTextBuffer(textView.TextBuffer); Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer)); Assert.Same(textView, vimBuffer.TextView); Assert.Same(vimTextBuffer, vimBuffer.VimTextBuffer); }