TDD for Cocos2d-X in android
Asked Answered
S

1

15

How do I write the TDD for "is sprite added or not" in the scene for cocos2d-x in eclipse. Here is my code

CCSprite *sprite  =null;

//adding sprite code
sprite = new CCSprite();
sprite->initWithSpriteFrameName(“abc.png");
this->addChild(sprite);

Any blog or help in right direction will be appreciated. Thanks

Storytelling answered 4/4, 2014 at 9:26 Comment(0)
M
0

Generally speaking, you don't test the platform (or framework) you're using. You trust that it works. You do need to test that your code interacts with it correctly instead.

This usually means hiding external APIs behind an interface, and then mocking that interface. This video explains how to approach that.

Moonscape answered 12/5, 2014 at 17:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.