i create a view controller viewsampleViewController.. And it has two method setname and getname.. i create a testcase for that view controller. my testcase name is newTestCase and method name is testName.
#import "newTestCase.h"
#import "viewsampleViewController.h"
@implementation newTestCase
in my testName method,
-(void)testName{
NSString *b=@"hello";
v =[[viewsampleViewController alloc] init];
STAssertNotNil(v,@"v doesnt created");
[v setuname:@"hello"];
NSString *a=[v getuname];
STAssertEquals(b,a,@"error:name not equal");
[v release];
}
-(void)setUp{
v=[viewsampleViewController alloc];
}
-(void) tearDown{
[v release];
}
when i build i got an error
Ld "build/Debug-iphoneos/Unit test.octest/Unit test" normal armv6
cd /Users/anande/Documents/viewsample
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1.3
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -bundle -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk -L/Users/anande/Documents/viewsample/build/Debug-iphoneos -F/Users/anande/Documents/viewsample/build/Debug-iphoneos -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/Developer/Library/Frameworks -filelist "/Users/anande/Documents/viewsample/build/viewsample.build/Debug-iphoneos/Unit test.build/Objects-normal/armv6/Unit test.LinkFileList" -dead_strip -framework Foundation -framework SenTestingKit -miphoneos-version-min=3.1.3 -o "/Users/anande/Documents/viewsample/build/Debug-iphoneos/Unit test.octest/Unit test"
Undefined symbols:
"_OBJC_CLASS_$_viewsampleViewController", referenced from:
__objc_classrefs__DATA@0 in newTestCase.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
plz help me,