This project is read-only.

Test that members are matching a pattern

New in v1.3

It's possible to ensure that all members are matching a pattern defined by a regular expression (regex). For this you need to specify your system-under-test for members. If you're not familiar with the way to specify a test on members of a dimension, read first the article about Tests on dimension's members.

Assertion

The assertion consists in a check about the members' caption pattern in the hierarchy or level specified. So we need to specify that we'll perform an assertion of type matchPattern

<test>
    <assert>
        <matchPattern />
    </assert>
</test>

For the moment, the only feature developed is to define a regular expression (regex) and check the pattern according to this regex.

<assert>
<matchPattern>
<regex>^\sa-zA-Z,\s+\s$</regex>
</matchPattern>
</assert>

If we're checking that the members of level Departments in the hierarchy named Departments of dimension Department have a literal name, we can use the following test:
<test name="All departments have a correct format" uid="0001">
		<system-under-test>
			<members children-of="Corporate">
				<level caption="Departments" hierarchy="Departments" dimension="Department" perspective="Adventure Works"/>
			</members>
		</system-under-test>
		<assert>
			<matchPattern>
				<regex>^\s*[a-zA-Z,\s]+\s*$</regex>
			</matchPattern>
		</assert>
	</test>

This kind of test can be really useful to ensure that you're displaying the correct fields on the cube.

Last edited Nov 7, 2013 at 11:05 PM by Seddryck, version 1

Comments

No comments yet.