12#include <com/sun/star/sheet/SheetLinkMode.hpp>
13#include <com/sun/star/sheet/XSheetLinkable.hpp>
14#include <com/sun/star/uno/Reference.hxx>
16#include <cppunit/TestAssert.h>
19using namespace css::uno;
25 uno::Reference< sheet::XSheetLinkable > xSheetLinkable(
init(), UNO_QUERY_THROW);
27 xSheetLinkable->link(
getFileURL(),
"Sheet1",
"",
"", sheet::SheetLinkMode_VALUE);
28 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get link mode",
29 sheet::SheetLinkMode_VALUE, xSheetLinkable->getLinkMode());
30 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get link URL",
32 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get sheet name",
33 OUString(
"Sheet1"), xSheetLinkable->getLinkSheetName());
35 xSheetLinkable->setLinkMode(sheet::SheetLinkMode_NONE);
36 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set link mode",
37 sheet::SheetLinkMode_NONE, xSheetLinkable->getLinkMode());
39 xSheetLinkable->setLinkSheetName(
"Sheet2");
40 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set sheet name",
41 OUString(
"Sheet2"), xSheetLinkable->getLinkSheetName());
44 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set link URL",
virtual OUString getFileURL()=0
virtual css::uno::Reference< css::uno::XInterface > init()=0