Search code examples
iosios7static-librariesxctestmainbundle

Static library test using XCTestCase


I am creating object of ISession class which gives me singleton instance,

when object is allocated and initialized it pickup values from plist file,

I am getting nil on [[NSBundle mainBundle] pathForResource:@"Manifest" ofType:@"plist"] so that object creation get fail.

Can someone provide solution, So that I can write test cases within static library instead of project.

Thanks.


Solution

  • Create Mock objects in code, representing your data from the plist and instantiate them in the setUp method of your Test file

    Static Libraries are not meant to have resources.