Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include <com/sun/star/container/XNamed.hpp>
11 : #include <test/container/xnamed.hxx>
12 : #include "cppunit/extensions/HelperMacros.h"
13 :
14 : using namespace css;
15 : using namespace css::uno;
16 :
17 : namespace apitest {
18 :
19 0 : void XNamed::testGetName()
20 : {
21 0 : uno::Reference< container::XNamed > xNamed(init(), UNO_QUERY_THROW);
22 0 : CPPUNIT_ASSERT( maName == xNamed->getName() );
23 0 : }
24 :
25 0 : void XNamed::testSetName()
26 : {
27 0 : uno::Reference< container::XNamed > xNamed(init(), UNO_QUERY_THROW);
28 0 : OUString aName("NewName");
29 :
30 0 : xNamed->setName(aName);
31 0 : CPPUNIT_ASSERT( aName == xNamed->getName() );
32 :
33 : // restore old name
34 0 : xNamed->setName(maName);
35 0 : CPPUNIT_ASSERT(maName == xNamed->getName());
36 0 : }
37 :
38 0 : XNamed::~XNamed()
39 : {
40 0 : }
41 :
42 0 : }
43 :
44 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|