14#include <com/sun/star/beans/PropertyValue.hpp>
15#include <com/sun/star/sheet/FunctionArgument.hpp>
17#include <cppunit/TestAssert.h>
26 const uno::Sequence<beans::PropertyValue> aFunctionDescription(
init());
28 std::vector<OUString> names;
32 for (
const auto&
value : aFunctionDescription)
34 if (
value.Name ==
"Id")
36 names.push_back(
value.Name);
40 else if (
value.Name ==
"Category")
42 names.push_back(
value.Name);
46 else if (
value.Name ==
"Name")
48 names.push_back(
value.Name);
50 CPPUNIT_ASSERT(
value.Value >>= sValue);
52 else if (
value.Name ==
"Description")
54 names.push_back(
value.Name);
56 CPPUNIT_ASSERT(
value.Value >>= sValue);
58 else if (
value.Name ==
"Arguments")
60 names.push_back(
value.Name);
61 uno::Sequence<sheet::FunctionArgument> sArguments;
62 CPPUNIT_ASSERT(
value.Value >>= sArguments);
66 OString aMsg =
"Unsupported PropertyValue: "
68 CPPUNIT_FAIL(aMsg.getStr());
72 CPPUNIT_ASSERT_MESSAGE(
"Property Id not found",
73 std::count(std::begin(names), std::end(names),
"Id"));
74 CPPUNIT_ASSERT_MESSAGE(
"Property Category not found",
75 std::count(std::begin(names), std::end(names),
"Category"));
76 CPPUNIT_ASSERT_MESSAGE(
"Property Name not found",
77 std::count(std::begin(names), std::end(names),
"Name"));
78 CPPUNIT_ASSERT_MESSAGE(
"Property Description not found",
79 std::count(std::begin(names), std::end(names),
"Description"));
80 CPPUNIT_ASSERT_MESSAGE(
"Property Arguments not found",
81 std::count(std::begin(names), std::end(names),
"Arguments"));
void testFunctionDescriptionProperties()
virtual css::uno::Sequence< css::beans::PropertyValue > init()=0
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)