Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Mocking test data with custom types

Satinder Rawal answered on April 22, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • set type for mock class typescript jest mock
  • Use @Test Annotation on Test Methods
  • is the method annotated with @test
  • Mocking in test cases for Static methods.
  • Writing tests in a service using Mockito
  • What are the different mocking annotations that you worked with?
  • Using custom types in Contract unit tests

  • Mocking test data with custom types

    0

    The Contracts SDK has access to all custom Smart Contract types and Supervisor Contract types available in the Contract API. Different versions of the Contracts language library have access to different version types.

    When using custom types in Contract unit tests you must:

    Import these from the same Contracts API version as the Contract code that is being tested

    Use the same version unit test base class as the Contracts API in the Contracts code

    The custom types registry

    As custom types in the Contracts SDK also include type checking, the types registry must be initialised before any custom type classes can be used. This is done automatically in all the Contracts unit tests base classes. However, if you want to import and initialise any of the types without the base classes, you must initialise the types registry manually: 

    Popularity 1/10 Helpfulness 1/10 Language python
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Apr 22 2023
    Satinder Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.