Show
Ignore:
Timestamp:
04/11/06 08:14:31 (3 years ago)
Author:
jordi
Message:

I added the dumb document and main view for testing.

I had to create a Document Interface (IDocument) to handle the dumb document for tests. I moved the Document.{cxx,h} files to PDFDocument.{cxx,h}. The rotation, page change and scaling functions remains in IDocument, as well as the error functions and enumerations. The PDF specific portions of the document has been kept in the PDFDocument class.

The test name is also updated to PDFDocumentTest, and all tests runs OK.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/MainPterTest.cxx

    r20 r21  
    1717 
    1818#include <epdfview.h> 
     19#include "DumbDocument.h" 
     20#include "DumbMainView.h" 
    1921#include "MainPterTest.h" 
    2022 
     
    3032MainPterTest::setUp () 
    3133{ 
     34/*    m_Document = new DumbDocument (); 
     35    m_MainPter = new MainPter (m_Document); 
     36    m_View = new DumbMainView (m_MainPter); 
     37    m_MainPter->setView (m_View);*/ 
    3238} 
    3339 
     
    3844MainPterTest::tearDown () 
    3945{ 
     46    // We only need to delete the presenter, as all other 
     47    // classes are deleted by it. 
     48//    delete m_MainPter; 
    4049} 
     50 
     51/// 
     52/// @brief Tests the initial status of the main presenter. 
     53/// 
     54/// Initially the presenter hasn't loeaded a document, yet, so 
     55/// the main window's title is 'PDF Viewer', the page selection  
     56/// and zoom actions are unsensitived and the documentView has 
     57/// no image yet. 
     58/// 
     59void 
     60MainPterTest::initialStatus () 
     61{ 
     62/*    CPPUNIT_ASSERT ( m_View->isShown () ); 
     63    CPPUNIT_ASSERT_EQUAL (0,  
     64            g_ascii_strcasecmp ("PDF Viewer", m_View->getTitle ())); 
     65    CPPUNIT_ASSERT (!m_View->isSensitiveGoToFirstPage ()); 
     66    CPPUNIT_ASSERT (!m_View->isSensitiveGoToLastPage ()); 
     67    CPPUNIT_ASSERT (!m_View->isSensitiveGoToNextPage ()); 
     68    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 
     69    CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 
     70    CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 
     71    CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); 
     72    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
     73    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
     74    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); */ 
     75}