summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-02-23 15:23:39 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-01 15:38:02 +0100
commita5c891f59e7dfd81281b8bcc1b54c03f4e395203 (patch)
treee6a813d57e16bedaa30eaf67fef390b9e4ca6a1d /test/source
parent956c9d1775b14c116b8b8ee4bc576a126d36c63f (diff)
add test case for XSpreadsheetDocument
Diffstat (limited to 'test/source')
-rw-r--r--test/source/sheet/xspreadsheetdocument.cxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/source/sheet/xspreadsheetdocument.cxx b/test/source/sheet/xspreadsheetdocument.cxx
new file mode 100644
index 000000000000..a7720f621dbd
--- /dev/null
+++ b/test/source/sheet/xspreadsheetdocument.cxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <test/sheet/xspreadsheetdocument.hxx>
+#include <com/sun/star/sheet/XSpreadsheets.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include "cppunit/extensions/HelperMacros.h"
+
+using namespace com::sun::star::uno;
+
+namespace apitest {
+
+void XSpreadsheetDocument::testGetSheets()
+{
+ uno::Reference< sheet::XSpreadsheetDocument > xSpreadsheetDoc(init(), UNO_QUERY_THROW);
+ uno::Reference< sheet::XSpreadsheets > xSheets = xSpreadsheetDoc->getSheets();
+ CPPUNIT_ASSERT(xSheets.is());
+
+ uno::Reference< container::XIndexAccess > xIA(xSheets, UNO_QUERY_THROW);
+ CPPUNIT_ASSERT( xIA->getCount() == mnSheets );
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */