From f2462b220562dc961f0858073389ed9ef3bbf571 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 17 Mar 2015 08:28:20 +0100 Subject: add XIndex interface tests for ScCondFormatObj Change-Id: I55604485183057f476c636abc4d43bc9fc58711a --- sc/qa/extras/new_cond_format.cxx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'sc/qa/extras/new_cond_format.cxx') 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 xCondFormatList = + getConditionalFormatList(init(1)); + + uno::Sequence > xCondFormats = + xCondFormatList->getConditionalFormats(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xCondFormats.getLength()); + + uno::Reference 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++; -- cgit