summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-11-01 23:55:50 +0000
committerJens Carl <j.carl43@gmx.de>2017-11-03 04:09:44 +0100
commit44e9640748791f602edb22cbc499200283466e1e (patch)
treecf10452b780bba32740d9072604bfb5ddc99e0d4 /test/source
parent6bddeb4de19685c1ce1a3c1f9bd32cffb6b14bc6 (diff)
tdf#45904 Move Java _XSheetConditionalEntries test to C++
Change-Id: I96c1b0dc8d6c6b9cc4f8e02ef8c9ca184fb4d6a4 Reviewed-on: https://gerrit.libreoffice.org/44184 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test/source')
-rw-r--r--test/source/sheet/xsheetconditionalentries.cxx59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/source/sheet/xsheetconditionalentries.cxx b/test/source/sheet/xsheetconditionalentries.cxx
new file mode 100644
index 000000000000..e22f3b8195e9
--- /dev/null
+++ b/test/source/sheet/xsheetconditionalentries.cxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/sheet/xsheetconditionalentries.hxx>
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/sheet/ConditionOperator.hpp>
+#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+namespace apitest {
+
+void XSheetConditionalEntries::testAddNew()
+{
+ uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW);
+ const sal_Int32 aCount = xSheetConditionalEntries->getCount();
+
+ xSheetConditionalEntries->addNew(createCondition(4));
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to add new condition",
+ aCount + 1, xSheetConditionalEntries->getCount());
+
+}
+
+void XSheetConditionalEntries::testClear()
+{
+ uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW);
+ xSheetConditionalEntries->clear();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to clear conditions",
+ sal_Int32(0), xSheetConditionalEntries->getCount());
+}
+
+void XSheetConditionalEntries::testRemoveByIndex()
+{
+ uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW);
+ const sal_Int32 aCount = xSheetConditionalEntries->getCount();
+
+ xSheetConditionalEntries->removeByIndex(0);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove condition",
+ aCount - 1, xSheetConditionalEntries->getCount());
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */