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

1

3

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

Joerg answered 15/4, 2010 at 5:14 Comment(1)
Please stop creating redundant tags. OCUnit is SenTestingKit. See stackoverflow.com/questions/tagged/ocunit.Cris
B
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 drawing your NSString (I suppose), then I do not think your can test that this drawing happend properly. If you use a separate view like a UITextLabel you could test for its existance by using STAssertNotNil. You could also check the proper positioning by checking the view's bounds.

If you need more help, please be a bit more specific and adding clean code would help.

Boatswain answered 18/6, 2010 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.