ocunit

XCode 7: Unable to Convert OCUnit to XCTest

北战南征 提交于 2019-12-22 10:34:18
问题 I upgraded the XCode to 7.0 and ran into compilation issues. XCode asked me to convert my test target to use XCTest and I followed the wizard screen. I'm unable to find any test targets and cannot finish converting. Does any one know how to fix this ? Thanks. 回答1: Make sure you have selected the scheme of your test target (in the top-left scheme selector), then select Edit -> Convert -> To XCTest... This will make Xcode recognize the appropriate target. 来源: https://stackoverflow.com/questions

Xcode 4 unit testing linker error

a 夏天 提交于 2019-12-20 12:21:44
问题 NOTE: "Use GHUnit" is not an acceptable answer to this question. I know most think GHUnit is better than the Xcode4 OCUnit, but that's not what I'm asking about. I'll evaluate that separately. I have an Xcode project that I created in Xcode4 from scratch, with the "Include unit tests" checkbox checked during creation. I have also included some libraries I developed in a previous project. They were added to the project via the "Add Files to x..." dialog and only added to the application target

Apple Mach-O Linker Error using Core Data classes in OCUnit

倖福魔咒の 提交于 2019-12-19 19:56:40
问题 OK, here's my code in my test class: - (NSManagedObjectContext*)managedObjectContextWithConcurrencyType:(NSManagedObjectContextConcurrencyType)concurrencyType { NSManagedObjectModel *mom = [NSManagedObjectModel mergedModelFromBundles:nil]; STAssertNotNil(mom, @"Can not create MOM from main bundle"); NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom]; STAssertNotNil(psc, @"Can not create persistent store coordinator"); NSPersistentStore

Some of my unit tests tests are not finishing in XCode 4.4

大憨熊 提交于 2019-12-18 12:46:09
问题 I have seen people posting about this here and elsewhere, but I haven't found any solution that works. I am using XCode 4.4 and have a bunch of unit tests set up. I have ran them all before on this project, so I know that they do pass/fail when they are supposed to if they are actually ran. I have about 15 test suites, and each one contains 1-7 tests. On most attempts, all of the test suites finished (and passed) except for 1 (FooTests). It gives the warning: FooTests did not finish testFoo

Occasional errors when running OCUnit application test suite on device

天涯浪子 提交于 2019-12-18 12:17:36
问题 I'm having some problems with my OCUnit test suite, when running application tests (i.e. on the device). Occasionally, I get a tricky error that seems to be thrown from the OCUnit classes. I've been trying to look through the files added to the test suites, but can't get my head around it. I've followed the Apple documentation and looked at other tutorials when setting up my test targets, resulting in the following targets (and indented dependencies): LogicTests MyApp LogicTests

How do I migrate from SenTestingKit/OCUnit to XCTest?

孤街醉人 提交于 2019-12-18 10:41:38
问题 I am in the process of migrating my project from Xcode 4.6.3 to Xcode 5.0.2. The project's unit tests were developed with SenTestingKit/OCUnit. Now when I am running the tests in Xcode 5, I get an error from the RunUnitTests script telling me that RunUnitTests is obsolete. Possibly related is this note in the Xcode 5 release notes: SenTestingKit and OCUnit are deprecated. Use the migrator to move to XCTest. Unfortunately, I have not been able to find out more about this mysterious "migrator".

Unit Testing Example with OCUnit

﹥>﹥吖頭↗ 提交于 2019-12-18 09:54:49
问题 I'm really struggling to understand unit testing. I do understand the importance of TDD, but all the examples of unit testing I read about seem to be extremely simple and trivial. For example, testing to make sure a property is set or if memory is allocated to an array. Why? If I code out ..alloc] init] , do I really need to make sure it works? I'm new to development so I'm sure I'm missing something here, especially with all the craze surrounding TDD. I think my main issue is I can't find

How to write test cases for drawing text / string in a box?

半腔热情 提交于 2019-12-13 14:20:52
问题 I am drawing strings in a rectangular frame. The string is drawing perfectly. Now I need to write test cases using sentesting kit. I have no ideas from where I should start. For help I have also seen the iPhone sample calculator application But still out of sorts. Any body having ideas please help. Thanks, Madhup 回答1: GUI drawing code is often hard to test. In your case it depends how you draw your string. If you draw it into a custom view by using the -(void)drawRect: method and therein just

OCUnit test cases not running

家住魔仙堡 提交于 2019-12-12 02:56:43
问题 If I create a new project which includes unit tests, the test cases get called. But when I'm adding tests to an existing project I'm getting the following in the log: 2013-05-21 19:41:08.814 otest[51593:7e03] Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size Test Suite '/Users/impadmin/Library/Developer/Xcode/DerivedData/SmartDiary-frrybdtgyyjgewbialqsmxkwvlxs/Build/Products/Debug-iphonesimulator/testSmartDiary.octest(Tests)' started at 2013-05-21 14:11:09 +0000 Test

isMemberOfClass doesn't work as expected with ocunit [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-11 11:38:57
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: 'isMemberOfClass' returning 'NO' when custom init I've some trouble with the "isMemberOfClass"-Method. I have a class, that generates and returns objects (" MyObject ") // ObjectFactory.h ... -(MyObject*)generateMyObject; ... // ObjectFactory.m ... -(MyObject*)generateMyObject { MyObject *obj = [[MyObject alloc]init]; obj.name = @"Whatever"; // set properties of object return obj; } ... And there's a unittest