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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top