Dismiss Notice

Register now to be one of the first members of this SharePoint Community! Click here it just takes seconds!

Dismiss Notice
Welcome Guest from Country Flag

Dynamics Retail Discount Extensibility – Test Foundation

Discussion in 'Official Microsoft News' started by Zhiyi Zhang, Apr 13, 2017.

Thread Status:
Not open for further replies.
  1. Zhiyi Zhang

    Zhiyi Zhang Guest

    Blog Posts:
    0
    Creating a new discount type is a complex task as we really need to understand how discount works functionally. Assuming we have just created a new discount type, how do we test it out? We can always deploy it to Dynamics Lifecycle Services sandbox and test it out there. I have it tried a few times. It is a great experience for me, but it would be time-consuming for daily development.

    Introduce the test foundation for Dynamics retail pricing engine.


    It is under private review. If you need it now, ping me or your Dynamics retail extensibility team contact.

    In short, you can run component level unit test in your SDK.

    1. Mock pricing data accessor with XML. If you remember, we have IPricingDataAccessor to bridge the difference between AX and channel data access.
    2. Automatic validation of data integrity.
    3. Miscellaneous utilities.
    Now, technical details.


    It is more of a reference below. You may skip to sample test post.

    Test data interface ITransactionSetupAndDataManager


    It inherits from pricing engine data accessor: IPricingDataAccessor. In addition, it helps with test data setup

    1. Test configurations: concurrency control model, compound behavior, and hold-or-split-for-rounding, etc.
    2. AddPriceGroupToTransaction and AddPriceGroupsToTransaction: this sets up the (mock) discounts for the discount calculation.
    Default mock implementation of ITransactionSetupAndDataManager


    TestFoundationPricingDataManager

    Data integration verification


    SalesTransactionVerification

    Mock (main) discount data types.


    PeriodicDisocuntData and PeriodicDiscountLineData. You need to know them if you want to extend them to support your new discount types.

    Helpers


    TestFoundationCommonData

    TestFoundationPriceContextHelper

    TestFoundationPricingHelper

    TestFoundationSalesTransactionHelper

    Related: Dynamics Retail Discount Extensibility – Main picture

    Related: Dynamics Retail Discount Extensibility – Sample Test

    Continue reading...
     
Thread Status:
Not open for further replies.

Share This Page

LiveZilla Live Chat Software