sentestingkit

Getting iPhone Documents Directory in TestCases

左心房为你撑大大i 提交于 2020-01-06 07:15:46
问题 I'm running test cases which uses sqlite database to test my code on iPhone simulator using default SenTestingkit, when i try to get the home directory using either of the following ways NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docsPath = [paths objectAtIndex:0]; or NSString *home = NSHomeDirectory(); i got a wrong path that points to the following bath /Users/{user}/Library/Application Support/iPhone Simulator/5.1 and i

Can't Access the storyboard from SenTeskingKit

…衆ロ難τιáo~ 提交于 2020-01-03 04:32:05
问题 my question is that I am trying to test some stuff from SenTesking Kit. -(void)testStoryboard { storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; STAssertNotNil(storyBoard, @"Can't access the storyboard"); } I have also added the UIMainStoryboardFile to the DemoTests.plist but am getting this kind of error: error: testStoryboard (DemoTests) failed: Could not find a storyboard named 'MainStoryboard' in bundle NSBundle</Developer/Platforms/iPhoneSimulator.platform

Where does OCUnit store NSUserDefaults?

陌路散爱 提交于 2019-12-24 07:09:47
问题 I read the question Easy way to see saved NSUserDefaults? I found the .plist file for the app, but where's the one for the testing bundle? 回答1: If you use Xcode 4's integration with OCUnit, it injects the test bundle into a running application. NSUserDefaults are therefore saved in the application itself. This is problematic for unit tests: When you run the app manually, your defaults may have been overwritten by your tests. Instead of using [NSUserDefaults standardUserDefaults] directly, use

XCTest build errors for test target Xcode 5:

匆匆过客 提交于 2019-12-17 18:39:13
问题 I have set up an XCode 5 iOS 7 project for unit tests. Of course, setting up the unit tests are taking me so long that I'm trying to keep the faith that it's worth it. Struggling for hours over this error: ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode5-DP5.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386 Any ideas on how to solve? 回答1: Check your Framework Search Paths in your test target settings.

Asynchronous unit test not being called by SenTestCase

混江龙づ霸主 提交于 2019-12-13 07:15:10
问题 When I am running my unit test, I don't reach my breakpoint, and I think that the test isn't properly running my code. I am trying to do an asynchronous test, which is part of my difficulty. How do I set up the test so that testLookupBook will be called, as I hope that that will lead to everything else being called properly. I am guessing that the function to test should be somewhere in the header file, but I did start my test method with test . Here is my header file: @interface

Logic Testing on iOS devices is not supported?

旧时模样 提交于 2019-12-10 02:24:54
问题 I am using the SenTestingKit to Unit Test, but I get the following message Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator. How can I do this? 回答1: Logic tests only work on the simulator, you need to switch to the simulator, i.e. Logic tests require a special unit test launcher which is not installed on actual devices. If you want to run your tests on an actual device you can convert to application unit tests. These are essentially the same but you

What are the advantages of XCTest over SenTestingKit?

为君一笑 提交于 2019-12-09 04:21:22
问题 I want to do unit testing in iOS. By default test classes are created using XCTest framework classes in Xcode 5. I have used SenTestingKit in earlier versions of iOS. What are the differences between these two frameworks? What are the advantages of XCTest framework. I googled for related documentation but I did not find any. Only thing I found is the interface classes to use inside the kit. Can anyone point me to the related resources. 回答1: Apple's documentation is notably lacking with

Why is SenTestingKit causing my app to crash?

笑着哭i 提交于 2019-12-06 03:49:28
问题 I've created a map-based app for the iPhone, and recently submitted it to the store. I had no trouble running the app on the device or simulator. However, the store rejected it because it crashed on launch. The crash logs complain that the SenTestingKit framework wasn't found: Date/Time: 2012-02-21 19:02:26.048 -0800 OS Version: iPhone OS 5.0.1 (9A405) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crashed Thread: 0 Dyld Error Message:

Running SenTestingKit unit tests in Instruments

陌路散爱 提交于 2019-12-05 20:14:59
问题 I'm developing a database-access library and I'm trying to check for memory leaks using already-written unit tests. These are logic tests based on SenTestingKit, set up the normal way in Xcode 4.2. I can run them fine using Cmd-U but don't see a way to start them from Instruments, or to invoke Instruments to examine them. How can I make this work? Do I need to write new cases and build them into an application? (This question is about leak-checking unit tests but I think is pre-SenTestingKit.

Why is SenTestingKit causing my app to crash?

拟墨画扇 提交于 2019-12-04 07:44:21
I've created a map-based app for the iPhone, and recently submitted it to the store. I had no trouble running the app on the device or simulator. However, the store rejected it because it crashed on launch. The crash logs complain that the SenTestingKit framework wasn't found: Date/Time: 2012-02-21 19:02:26.048 -0800 OS Version: iPhone OS 5.0.1 (9A405) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crashed Thread: 0 Dyld Error Message: Library not loaded: /Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit Referenced from: