Unit test private class in Objective-C

600 views Asked by At

How do you unit test a private class in Objective-C? Is it possible when both the @interface and the @implementation of the class are included in a .m implementation file?

Refactoring the interface of the private class into its own header is not allowed by the restrictions of the project.

This is a whole private class I would like to test, not a private method of a public class.

1

There are 1 answers

2
hpique On BEST ANSWER

Apparently, duplicating the private interface in the test file is enough. Damn, Objective-C is dangerous!