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

Support of variables for measure attribute #566

Open
lukzas opened this issue Nov 28, 2019 · 5 comments
Open

Support of variables for measure attribute #566

lukzas opened this issue Nov 28, 2019 · 5 comments
Milestone

Comments

@lukzas
Copy link
Contributor

lukzas commented Nov 28, 2019

I have two scenarios where it would be handy to have variable support:

  1. I'd like to user variable inside the expression
<expression name="TotalPriceWithVAT">UnitPrice*Quantity*@MultiplyFactor</variable>
  1. When using <instance-settling>
<system-under-test>
      <structure>
        <measure caption="@Caption" perspective="@Perspective"/>
      </structure>
</system-under-test>
  1. Is instance variable scope limited to <system-under-test>? It seems I can't use a variable as below
<assert>
        <equal-to>
          <query>
            <parameter name="@table">@Table</parameter>
              SELECT * FROM @table
          </query>
        </equal-to>
</assert>

Maybe it is already possible and I don't know how to configure, in case it's not let me know your thoughts. I guess the latter might be a rough one 😉

@Seddryck
Copy link
Owner

I’ll need to double-check but it should not be a big issue to support variables in NCalc expressions. Will try to add it for next release.

About using variables in an assertion, it is already globally supported. But something that could be potentially not supported is to use a variable for a specific element or attribute. Could you post your test and highlight which element or attribute has an issue. I know that the comparison of result-sets have a good support for variables but not assertions on structures.

@Seddryck
Copy link
Owner

For the third case, I’d try to switch to equal-to\result-set\query in place of equal-to\\query. Using the canonical form could help.

@lukzas
Copy link
Contributor Author

lukzas commented Nov 29, 2019

For the third case, I’d try to switch to equal-to\result-set\query in place of equal-to\\query. Using the canonical form could help.

At line 46: The element 'assert' in namespace 'http://NBi/TestSuite' has invalid child element 'resultSet' in namespace 'http://NBi/TestSuite'

@lukzas
Copy link
Contributor Author

lukzas commented Nov 29, 2019

Could you post your test and highlight which element or attribute has an issue.

<test name="Measure Exist">
    <instance-settling>
      <local-variable name="PerspectiveName" type="text">
          <item>Claims</item>
          <item>Assessors</item>
      </local-variable>
    </instance-settling>
    <system-under-test>
      <structure>
        <!-- variable is not evaluated in this context -->
        <measure caption="Additional Report" perspective="@PerspectiveName"/> 
      </structure>
    </system-under-test>
    <assert>
      <exists />
    </assert>
</test>

@Seddryck Seddryck changed the title Feature request - Support of variables inside expression and measure attribute Support of variables for measure attribute Dec 1, 2019
@Seddryck Seddryck added this to the v2.1 milestone Dec 1, 2019
@Seddryck
Copy link
Owner

Seddryck commented Dec 1, 2019

I opened #567 and #568 to differentiate the issues/feature-requests reported.

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