12#include <com/sun/star/container/NoSuchElementException.hpp>
13#include <com/sun/star/container/XNameAccess.hpp>
15#include <com/sun/star/uno/Reference.hxx>
16#include <com/sun/star/uno/Sequence.hxx>
18#include <cppunit/TestAssert.h>
21using namespace css::uno;
27 uno::Reference<container::XNameAccess> xNA(
init(), uno::UNO_QUERY_THROW);
30 CPPUNIT_ASSERT_NO_THROW(xNA->getByName(
m_aName));
32 CPPUNIT_ASSERT_THROW(xNA->getByName(
m_aName +
"UnitTest"), container::NoSuchElementException);
37 uno::Reference<container::XNameAccess> xNA(
init(), uno::UNO_QUERY_THROW);
38 uno::Sequence<OUString> aNames = xNA->getElementNames();
40 CPPUNIT_ASSERT(aNames.hasElements());
45 uno::Reference<container::XNameAccess> xNA(
init(), uno::UNO_QUERY_THROW);
48 CPPUNIT_ASSERT(xNA->hasByName(
m_aName));
50 CPPUNIT_ASSERT(!xNA->hasByName(
m_aName +
"UnitTest"));
void testGetElementNames()
virtual css::uno::Reference< css::uno::XInterface > init()=0