Skip to content

Unable to mock subclasses of Bitmap #62

@weltraumpirat

Description

@weltraumpirat

I have several subclasses of Bitmap I need to use for a complex pixel transformation, and I've run into the following problem:

  • If I use the [Mock] annotation only, the test crashes and complains that the pixelSnapping argument must not be null. The funny thing is: all Bitmap constructor arguments have a default value, and so do the constructor args of my derived class.
  • If I use [Mock(args="constructorArgs")], I do not get any errors, and I verified that the constructorArgs function (which returns [null, "auto", true]) is called correctly. But instead of a mock object, null is assigned to the variable.
  • I get the same null result if I try nice(Bitmap, "", [null, "auto", true]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions