में मान्यता प्राप्त नहीं हैं I XCode 3.2.3, और आईओएस 4.0 पर ओसीयूनीट का उपयोग करके अपने आईफोन ऐप पर यूनिट परीक्षण कर रहा हूं। मैं सफलतापूर्वक उचित रूप से गुजरती हैं और बुनियादी परीक्षण विफल मेरी परीक्षण वातावरण की स्थापना की है, लेकिन जब मैं (मेरे अपने फ़ाइलें आयात इस मामले में, "UserAccount.h", यह संकलन करने में विफल रहता है और मुझसे कहता है:आयातित फ़ाइलें OCUnit
"_OBJC_CLASS_ $ _UserAccount ", संदर्भित से:
यह तो कहते हैं," प्रतीक (रों) नहीं मिला, "यह मेरे लिंकर त्रुटि के कुछ प्रकार के रूप में हमलों, लेकिन मुझे पता नहीं क्या हो रहा है है मैं का निर्माण किया है और सभी लक्ष्यों कई की सफाई की।। बार, लेकिन कोई फायदा नहीं हुआ। यहां मेरा परीक्षण कोड है:
#import "SomeTestCase.h"
#import "UserAccount.h"
@implementation SomeTestCase
- (void)testUserAccount
{
// UserAccount.m //
UserAccount *testAccount = [[UserAccount alloc] initWithUsername:@"" password:@"" deviceToken:@""];
[testAccount registerNew];
NSLog(@"USERID = %@", testAccount.userID);
STAssertEquals([testAccount login], NO, @"Failure: Login should fail with blank username and password."); // should fail with no username or password
UserAccount *testAccount2 = [[UserAccount alloc] initWithUsername:@"user" password:@"" deviceToken:@""];
STAssertEquals([testAccount2 login], NO, @"Failure: Login should fail with blank password.");// should fail with no password
UserAccount *testAccount3 = [[UserAccount alloc] initWithUsername:@"" password:@"pass" deviceToken:@""];
STAssertEquals([testAccount3 login], NO, @"Failure: Login should fail with blank username.");// should fail with no password
}
@end
कोई भी सलाह बहुत स्वीकृति होगी eciated। धन्यवाद!
-मैट
धन्यवाद! लक्ष्य में स्रोत जोड़ना चाल था। – mag725