diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-17 08:28:20 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-30 04:34:16 +0200 |
commit | f2462b220562dc961f0858073389ed9ef3bbf571 (patch) | |
tree | 1f710eb9ac78e4925912f76ec641d63b1d1c0f5f /sc/qa | |
parent | 0b1c4b8a0a5fb0b61cf044a2d54ba797fec69d9b (diff) |
add XIndex interface tests for ScCondFormatObj
Change-Id: I55604485183057f476c636abc4d43bc9fc58711a
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/new_cond_format.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index 88bccdd71cd5..e648edcfe0ae 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -20,7 +20,7 @@ using namespace css; namespace sc_apitest { -#define NUMBER_OF_TESTS 4 +#define NUMBER_OF_TESTS 5 class ScConditionalFormatTest : public CalcUnoApiTest { @@ -35,12 +35,14 @@ public: void testCondFormatListProperties(); void testCondFormatListFormats(); void testCondFormatProperties(); + void testCondFormatXIndex(); CPPUNIT_TEST_SUITE(ScConditionalFormatTest); CPPUNIT_TEST(testRequestCondFormatListFromSheet); CPPUNIT_TEST(testCondFormatListProperties); CPPUNIT_TEST(testCondFormatListFormats); CPPUNIT_TEST(testCondFormatProperties); + CPPUNIT_TEST(testCondFormatXIndex); CPPUNIT_TEST_SUITE_END(); private: @@ -148,6 +150,30 @@ void ScConditionalFormatTest::testCondFormatProperties() CPPUNIT_ASSERT_EQUAL(sal_Int32(16), aRange.EndRow); } +void ScConditionalFormatTest::testCondFormatXIndex() +{ + uno::Reference<sheet::XConditionalFormats> xCondFormatList = + getConditionalFormatList(init(1)); + + uno::Sequence<uno::Reference<sheet::XConditionalFormat> > xCondFormats = + xCondFormatList->getConditionalFormats(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xCondFormats.getLength()); + + uno::Reference<sheet::XConditionalFormat> xCondFormat = xCondFormats[0]; + CPPUNIT_ASSERT(xCondFormat.is()); + + uno::Type aType = xCondFormat->getElementType(); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.sheet.XConditionEntry"), aType.getTypeName()); + + CPPUNIT_ASSERT(xCondFormat->hasElements()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xCondFormat->getCount()); + /* + * missing implementation + uno::Any aAny = xCondFormat->getByIndex(0); + CPPUNIT_ASSERT(aAny.hasValue()); + */ +} + void ScConditionalFormatTest::setUp() { nTest++; |