Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Data Range Assertion

Chinnu
Chinnu Posts: 18

my xml file has a execution date " 26-11-2021T11:59:59"
my expected output date is Trade Date + 1 so something like this 28-11-2021T11:59:59
How can i validate this logic and how can i assert this ?
And this will vary for various trade events .
Can some one help me please?

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited December 2021

    my xml file has a execution date " 26-11-2021T11:59:59"

    Store this value using an XML Data Bank.

    my expected output date is Trade Date + 1

    Use the Data Generator Tool to add a day to your date-time. It will store the result in another data bank column.

    How can i validate this logic and how can i assert this ?

    Use an XML Assertor tool or Diff tool or small script (Extension tool) to compare the "Date + 1" value against the expected value.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    As another alternative, you could possibly do this comparison using an XPath expression which you could evaluate in an XML Data Bank or XML Transformer tool. I haven't tried this myself but XPath supports date arithmetic and has a built-in "days-from-duration" function. From stackoverflow: How to calculate date difference with XPath only?

  • Chinnu
    Chinnu Posts: 18

    Thank you very much
    I will give a try and share the result here