OCMock を静的クラス ライブラリに構成し、このような単純なメソッドを作成しました。
#import "IOSExample.h"
@implementation IOSExample
-(NSString *)MyTest
{
return @"Nuwanga";
}
-(int *)MyAge
{
int a=5;
int b=5;
int product=a*b;
return product;
}
@end
OCUnit テストでは、このメソッドを次のように作成しました。
-(void)testMyAge
{
int a=5;
int b=5;
int product=a*b;
STAssertTrue((product > 0), @"The Product was less than zero");
}
私の問題は、OCMock 単体テストで戻り値の型のテスト メソッドを作成するにはどうすればよいですか ???
ありがとう