PLSQL/Folding/test/unit/src/org/netbeans/modules/plsql/fold/FoldSearchObjectTest.java
author Subhashini Sooriarachchi <subslk@netbeans.org>
Mon, 12 Aug 2013 11:26:54 +0530
changeset 464 e10b2e8563fc
parent 360 612b49b47f2f
permissions -rw-r--r--
EADS-3749 encountering issues with the displaying of code in Developer Studio when code folding is enabled
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 package org.netbeans.modules.plsql.fold;
     6 
     7 import org.junit.Test;
     8 import static org.junit.Assert.*;
     9 import static org.mockito.Mockito.*;
    10 import org.netbeans.api.editor.fold.FoldType;
    11 
    12 /**
    13  *
    14  * @author ChrLSE
    15  */
    16 public class FoldSearchObjectTest {
    17 
    18    @Test
    19    public void shouldBeEqualWithAndWithoutBackingFoldObject() {
    20       int startOffset = 100;
    21       int endOffset = 200;
    22       FoldType foldType = PlsqlFoldTypes.COMMENT;
    23       FoldSearchObject searchObject1 = new FoldSearchObject(startOffset, endOffset, foldType);
    24       FoldAdapter fold = mock(FoldAdapter.class);
    25       FoldSearchObject searchObject2 = new FoldSearchObject(fold);
    26       when(fold.getStartOffset()).thenReturn(startOffset);
    27       when(fold.getEndOffset()).thenReturn(endOffset);
    28       when(fold.getFoldType()).thenReturn(foldType);
    29       assertEquals(searchObject1, searchObject2);
    30    }
    31 }