0

I am trying to write some unit test cases for iPhone app. but the results are little weird. I understand the result but want to know how to get actual No. of test cases failed and passed.

Executed 24 tests, with 29 failures (0 unexpected) in 71.791 (71.819) seconds

This just doesnt make sense. Yes, i Have multiple asserts in one case. it fails more than once, but shouldn't it fail one case only.

STAssertNil(var,@"error not nil"); STFail(@"not implemented yet");

There , this will say Executed 1 Tests, with 2 Failures

How to get Executed 1 Test Case, 1 Failed or Executed 24 Test Cases, 10 Failed, 14 Passed

4

1 に答える 1

0

Objective C テスト フレームワークは、1 つの tes を SenTestCase の 1 つのメソッドと見なします。失敗はアサーションの量を数えます。

各テストを 1 つのアサーションに対応させたい場合は、すべてのアサーションを独自のテスト メソッドに配置する必要があります。

于 2012-05-10T10:34:14.927 に答える