Questions tagged [ocunit]

OCUnit is a unit testing framework for the Objective-C language and included with Apple's Xcode IDE since Xcode 2.1.

OCUnit is a unit testing framework for the Objective-C language and included with Apple's Xcode IDE since Xcode 2.1.

It was created by Sen:te and modeled after the original Smalltalk unit testing framework. In design and use it is similar to classical JUnit, but taking advantage of Objective-C's runtime features to automatically locate tests to run.

263 questions
0
votes
4 answers

How do I catch OCUnit's test fail/success in command line?

My Expect: # Build Successed # and # Test Failed # Actual Result: only # Build Succeeded # How do I get fail/success in command line? [iphone, objective-c, xcode4, OCUnit] I'm newbe of OCUnit and Xcode4. I create…
Matt - sanemat
  • 5,418
  • 8
  • 37
  • 41
0
votes
1 answer

STAssertEquals NSTimeIntervals

I'm write unit test cases for my cocoa class. Below is the test case. I can't figure out why this test case fails, even though the expect and diff in the assert message are the same. I suspect it may have something to do with how double or…
Quincy
  • 1,923
  • 5
  • 27
  • 37
0
votes
3 answers

Do I have to do something to get OCunit tests to compile out of box with XCode 4?

I just installed XCode 4 today (using Apple mac app store), and I created a new Mac OS application, and tried to switch to test mode,and build the test skeleton code it generated for me. It failed here: In mytests.h: #import…
Warren P
  • 65,725
  • 40
  • 181
  • 316
0
votes
1 answer

Problem Installing OCUnit on my XCode 3

I'm using XCode 3 to develop MAC and iPhone apps. Because I'm thinking of doing a major modification on the structure of two of my systems, I need first to make unit tests. As I browsed on the internet about the different possibilities and since…
mikywan
  • 1,495
  • 1
  • 19
  • 38
0
votes
1 answer

OCUnit wants me to install Rosetta

I followed the instructions on Unit Testing objective C from Apple: http://developer.apple.com/tools/unittest.html I installed the latest version of OCUnit, but when I compile, software update starts and tells me I need to install Resetta. What's…
Jeffrey Aylesworth
  • 8,242
  • 9
  • 40
  • 57
0
votes
1 answer

OCUnit for iPhone App - Set all .m files as part of UnitTest Target

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…
Fernando
  • 1
  • 2
0
votes
1 answer

Trouble with OCUnit - Instantiating custom data type

I have successfully set up unit testing for an XCode version 3.2.2 project with the iPhone SDK version 3.1.2. I have created a class, "Callout" which I am attempting to instantiate within the context of a unit test. The class has a method, -(id)…
mag725
  • 695
  • 2
  • 9
  • 22
0
votes
0 answers

iOS OCUnit Deprecated cannot Convert to XCTest

Good day mates! I just want to ask if how can i fix this problem. I'm using xcode 5.1.1 with the device version 7.1.1, but this is working on xcode 5.0 and if the device is 7.0 below. but in this new updates im getting this problem. I Tried to look…
0
votes
2 answers

Link two or more SenTestCase

I am trying to change the existent defaultTestSuite method to create a class that can pick test methods from different classes and execute them in a specific order. However every time I import a test file in another test file i get a linker…
RicardoDuarte
  • 728
  • 7
  • 23
0
votes
1 answer

how to test something in nsthread

I want to use OCUnit to test my work. but one of my methodes is like this: - (BOOL)testThread { NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(thread) object:nil]; [thread start]; return YES; } -…
LazyChen
  • 3
  • 3
0
votes
1 answer

Is it safe to use properties in OCUnit?

I'm reading "Test-Driven iOS Development" by Graham Lee to learn OCUnit. I think it's a few versions behind Xcode, but is still a useful resource. In the book test objects are declared in a Class Extension like this: @interface BROAnswerTests :…
retrodev
  • 2,323
  • 6
  • 24
  • 48
0
votes
2 answers

How to Setup Unit Tests for cocos2d apps?

I have been trying to figure out how to setup OCUnit unit tests for my game that uses cocos2d. So I followed these instructions to set up the test target initially: http://blog.shalomfriss.com/?p=894 Unfortunately, the code below triggers a signal…
Charles Khunt
  • 2,375
  • 5
  • 25
  • 25
0
votes
1 answer

Different behaviour of asynchronous code in test target and deployment target

While trying to apply TDD to asynchronous code I found out that the same code that was working in the deployment target, didn't work in the test target. One of the examples of this problems I found using CLLocationManager: -…
Sergey
  • 47,222
  • 25
  • 87
  • 129
0
votes
2 answers

Test name in the setUp/tearDown methods

SetUp and tearDown methods are called on every test. Is it possible to know the current (running) test name in the setUp and tearDown methods? I need to do some extra work depending on what is the currently running test.
sash
  • 8,423
  • 5
  • 63
  • 74
0
votes
2 answers

OCMock stub class methods of the class that is being tested

+(NSString *) classMethod:(id)someDataObject { NSString *returnStr; //do something with someDataObject and set returnStr //... returnStr = [NSString stringWithFormat:@"%@%@", returnStr,[self getCurrentTimestamp]]; return…
sash
  • 8,423
  • 5
  • 63
  • 74