summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-11-11 09:09:30 +0000
committerJens Carl <j.carl43@gmx.de>2017-11-12 00:33:20 +0100
commite2b748e0a4ab7a33dd9ebde1d7f37776dff60c3b (patch)
tree3f5ce6727c8920e47e22ca36c00c64d19bcd1b3b /test
parentb73c66597884f03443ee8888cb6c204b78bb6cda (diff)
tdf#45904 Move _XScenarios Java test to C++
Change-Id: Ie15243714464cf8343fff27507e4b257846cdebd Reviewed-on: https://gerrit.libreoffice.org/44638 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xscenarios.cxx44
2 files changed, 45 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 49eab32c01cd..a76bbcf75474 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xnamedrange \
test/source/sheet/xnamedranges \
test/source/sheet/xprintareas \
+ test/source/sheet/xscenarios \
test/source/sheet/xspreadsheetdocument \
test/source/sheet/xspreadsheet \
test/source/sheet/xspreadsheets \
diff --git a/test/source/sheet/xscenarios.cxx b/test/source/sheet/xscenarios.cxx
new file mode 100644
index 000000000000..e8d007a8a1ff
--- /dev/null
+++ b/test/source/sheet/xscenarios.cxx
@@ -0,0 +1,44 @@
+/* -*- 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/xscenarios.hxx>
+
+#include <com/sun/star/sheet/XScenarios.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XScenarios::testAddNewByName()
+{
+ uno::Reference<sheet::XScenarios> xScenarios(init(), UNO_QUERY_THROW);
+
+ uno::Sequence<table::CellRangeAddress> aCellRangeAddresses(1);
+ aCellRangeAddresses[0] = table::CellRangeAddress(0, 0, 0, 0, 0);
+
+ xScenarios->addNewByName("XScenarios2", aCellRangeAddresses, "new");
+ CPPUNIT_ASSERT_MESSAGE("Unable to add new XScenario", xScenarios->hasByName("XScenarios2"));
+}
+
+void XScenarios::testRemoveByName()
+{
+ uno::Reference<sheet::XScenarios> xScenarios(init(), UNO_QUERY_THROW);
+
+ xScenarios->removeByName("XScenarios");
+ CPPUNIT_ASSERT_MESSAGE("Unable to remove XScenario", !xScenarios->hasByName("XScenario"));
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */