Search in sources :

Example 1 with MockDocument

use of com.intellij.mock.MockDocument in project intellij-community by JetBrains.

the class PsiDocumentManagerImplTest method testGetCachedPsiFile_NoFile.

public void testGetCachedPsiFile_NoFile() throws Exception {
    final PsiFile file = getPsiDocumentManager().getCachedPsiFile(new MockDocument());
    assertNull(file);
}
Also used : MockDocument(com.intellij.mock.MockDocument) MockPsiFile(com.intellij.mock.MockPsiFile)

Example 2 with MockDocument

use of com.intellij.mock.MockDocument in project intellij-community by JetBrains.

the class PsiDocumentManagerImplTest method testGetPsiFile_NotRegisteredDocument.

public void testGetPsiFile_NotRegisteredDocument() throws Exception {
    final PsiFile file = getPsiDocumentManager().getPsiFile(new MockDocument());
    assertNull(file);
}
Also used : MockDocument(com.intellij.mock.MockDocument) MockPsiFile(com.intellij.mock.MockPsiFile)

Example 3 with MockDocument

use of com.intellij.mock.MockDocument in project intellij-community by JetBrains.

the class PsiDocumentManagerImplTest method testGetUncommittedDocuments_documentNotRegistered.

public void testGetUncommittedDocuments_documentNotRegistered() throws Exception {
    final Document document = new MockDocument();
    WriteCommandAction.runWriteCommandAction(null, () -> changeDocument(document, getPsiDocumentManager()));
    assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length);
}
Also used : MockDocument(com.intellij.mock.MockDocument) Document(com.intellij.openapi.editor.Document) MockDocument(com.intellij.mock.MockDocument)

Aggregations

MockDocument (com.intellij.mock.MockDocument)3 MockPsiFile (com.intellij.mock.MockPsiFile)2 Document (com.intellij.openapi.editor.Document)1