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]);
I have several subclasses of Bitmap I need to use for a complex pixel transformation, and I've run into the following problem:
[Mock]annotation only, the test crashes and complains that thepixelSnappingargument must not benull. The funny thing is: all Bitmap constructor arguments have a default value, and so do the constructor args of my derived class.[Mock(args="constructorArgs")], I do not get any errors, and I verified that theconstructorArgsfunction (which returns[null, "auto", true]) is called correctly. But instead of a mock object,nullis assigned to the variable.nullresult if I trynice(Bitmap, "", [null, "auto", true]);