Beispiel #1
0
 void test_hyperlink()
 {
     xlnt::workbook wb;
     auto cell = wb.active_sheet().cell("A1");
     xlnt_assert(!cell.has_hyperlink());
     xlnt_assert_throws(cell.hyperlink(), xlnt::invalid_attribute);
     xlnt_assert_throws(cell.hyperlink("notaurl"), xlnt::invalid_parameter);
     xlnt_assert_throws(cell.hyperlink(""), xlnt::invalid_parameter);
     cell.hyperlink("http://example.com");
     xlnt_assert(cell.has_hyperlink());
     xlnt_assert_equals(cell.hyperlink(), "http://example.com");
 }
void HyperlinkCtrlTestCase::Click()
{
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__)
    EventCounter hyperlink(m_hyperlink, wxEVT_HYPERLINK);

    wxUIActionSimulator sim;

    sim.MouseMove(m_hyperlink->GetScreenPosition() + wxPoint(10, 10));
    wxYield();

    sim.MouseClick();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, hyperlink.GetCount());
#endif
}