Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare all results of a query with only one value (equal, lower, higher) #148

Closed
teulgreg opened this issue Dec 4, 2015 · 5 comments
Closed

Comments

@teulgreg
Copy link

teulgreg commented Dec 4, 2015

Hello Seddryck,

On our project we need to compare all the results of a query (sql or mdx) with only one expected value.

Example : we have a queries checking that all financial measures from a cube are not lower than 1 k€ .

Is it possible to create a new feature to compare all the results of a query with only one expected value
(alll results equal, lower or higher than one expected value) ?

thanks :-)

Gregory

@Seddryck
Copy link
Owner

Seddryck commented Dec 5, 2015

Hi Gregory,

It's a good idea and a planned feature.

In fact it's already possible to hack the feature Calculations in a resultset to implement this kind of test. But I agree that it's not user-friendly and it has some serious limitations ... more info about the way to hack this feature on my blog

@Seddryck Seddryck added this to the v1.13 milestone Dec 5, 2015
@teulgreg
Copy link
Author

teulgreg commented Dec 7, 2015

Thank u Cédric. :-)

Grégory

PS : Galla Pupel who you met last week at the SQL server days and work with me, says hello to you

@Seddryck
Copy link
Owner

I propose following syntax

<assert>
  <all-rows>
    <variable column-index=3>Sales</variable>
    <predicate name="Sales">
      <more-than>1000</more-than>
    <predicate>
  </all-rows>
</assert>

This test should assert that all the rows have a value greater than 1000 for column #3

Now that #133 is complete, I can create a variant to support this.

@teulgreg
Copy link
Author

I think it is a good syntax. It would be very usefull for our tests.

You should, if it is possible, also integrate with “more-than”, “less-than” and “equal-to” possibilities

@Seddryck
Copy link
Owner

The build https://ci.appveyor.com/project/CdricLCharlier/nbi/build/1.13.0-ci.16 introduces the assertions all-rows and no-rows. Feel free to download and provide feedback. Some examples are available at https://github.com/Seddryck/NBi/blob/master/NBi.Testing/Acceptance/Resources/Positive/QueryAllNoRows.nbits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants