| | 297 | /// |
| | 298 | /// @brief Test the last folder used to open a file. |
| | 299 | /// |
| | 300 | /// When the presenter wants to open a file, it should pass to the |
| | 301 | /// view the last folder that was used to open a file, so the |
| | 302 | /// view can show it up when opening the dialog. |
| | 303 | /// |
| | 304 | void |
| | 305 | MainPterTest::lastFolder () |
| | 306 | { |
| | 307 | m_View->setOpenFileName ("/tmp/test.pdf"); |
| | 308 | m_MainPter->openFileActivated (); |
| | 309 | CPPUNIT_ASSERT (NULL == m_View->getLastOpenFileFolder ()); |
| | 310 | |
| | 311 | |
| | 312 | m_View->setOpenFileName ("/usr/test.pdf"); |
| | 313 | m_MainPter->openFileActivated (); |
| | 314 | CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("/tmp", |
| | 315 | m_View->getLastOpenFileFolder ())); |
| | 316 | |
| | 317 | m_MainPter->openFileActivated (); |
| | 318 | CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("/usr", |
| | 319 | m_View->getLastOpenFileFolder ())); |
| | 320 | } |