zigbee-alliance/distributed-compliance-ledger

Unit tests refactoring for all modules

DenisRybas opened this issue · 0 comments

Scope:

  • Unit tests from all modules
  • Two goals:
    • check test coverage
    • refactoring/simplification

Details:

  • make sure Unit Tests coverage is enough
  • simplify the unit tests (simplify initialisation):
    • simplify initialisation and test stricture by creating helper functions, for example

      ```
      // prepare
      add_vendor()
      add_root_cert(cert_path)
      
      // execution
      add_revocation_point()
      
      //check
      asserts... 
      ```
      
    • get rid of magic numbers (for example, make sure VID constant is issued instead of hard-coded values)

  • improve error messages (all error text needs to be in errors.go's NewXXX methods, not error strings created on the fly).