views:

12

answers:

1

Hy everybody,

I have two targets: MyApp and UnitTests

MyApp contains two classes: ClassA and ClassB. ClassA has a method "getSomeNumber" that uses a ClassB method.

UnitTest is a "Unit Test Bundle" and in "Groups & Files" section i have a folder named "UnitTests" where i create a "MyAppTest" Class.

MyAppTest Class has the following method:

-(void)testSomething
{
   ClassA *cA = [[ClassA alloc] init];
   int x = [cA getSomeNumber];
   [cA release];
   STAssertEquals(1, x, @"The number is not equal to 1");
}

I imported the "ClassA.h" and now i need to set "ClassA.m" part of "UnitTest" target. When i build i have the error

"_OBJC_CLASS_$_ClassB", referenced from:

So i need to add "ClassB.m" to "UnitTest" taget and it Works.

What happens if ClassA uses ClassC that uses thousands of classes? I have this problem and i need to include thousand of class to the "UnitTest" Target.

I think it sould be a better solution or configuration to include my whole MyApp project into UnitTest target.

Thank you all! Regards.