Skip to main content

Unit Testing Business Rules

Comments

6 comments

  • Daniel Butler

    Also how can I get to the source of the Business Rules? That would help me refactor the code for the changes that are constantly being requested and implemented.

    0
  • Prajakta

    Hi Daniel,

    I don't think it would be possible to setup unit tests to test different features of a single business rule. However, you could use try-catch statements (see this documentation) with custom logging (see this documentation) in your business rules for better debugging.

    I am not sure I understand what you mean by source of the Business Rules. If you are looking for a way to get the code for all the rules in a form in one place, then you can use the View All feature for that.

    1
  • Daniel Butler

    Hi Prajakta,

    Sorry for the really late reply and thank you for your response! I am looking for a few things which make my ask a bit complicated. What I am looking for is the following:

    1. A way to put the business rules in a source control. I am currently using the view all feature you've pointed out to get a copy of the business rules. I was wondering if there was a way to get the business rules from somewhere on the server we are hosting Frevvo. I can setup a script to grab the code and push it into a version control repository.
    2. A way to setup selenium tests to automatically perform actions on the form as a functionality tests. What I am looking for here is the web address to access a frevvo form.
    3. Is there a way to run the business rules logic without having to interact with a form,that will help with unit tests?

    Hope that gives some clarity. I appreciate the time you have spent already answering my questions!

     

    0
  • Daniel Butler

    Good Morning! Follow up. Thank you!

    0
  • Prajakta

    Hi Daniel,

    1. The business rules are stored in the frevvo database in individual .formtype file for each form. I can't think of any easy way to get all the business rules directly from the frevvo database.

    2. frevvo forms are accessible with their share URLs. Please see this documentation which explains how to get a forms share URL which you can then use in your Selenium tests.

    3. You can use frevvo Data API to create form instances. I believe the rules will run in the background for such forms. Is this what you are looking for? You might want to go through these .Net API FAQs to get an idea of the functionality available via frevvo Data API.

    I hope that helps.

    -Prajakta

    0
  • Daniel Butler

    Prajakta that does make sense. It gives me enough so I can start looking into this deeper!

    0

Please sign in to leave a comment.