You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/08/22 08:27:00 UTC
[8/9] incubator-weex git commit: * [ios] add color2hex test
* [ios] add color2hex test
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/60cad949
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/60cad949
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/60cad949
Branch: refs/heads/0.16-dev
Commit: 60cad9498e0aa10d6ae6d18815c26441d53c599f
Parents: 1d87ab3
Author: doumafang <do...@gmail.com>
Authored: Tue Aug 22 16:06:06 2017 +0800
Committer: doumafang <do...@gmail.com>
Committed: Tue Aug 22 16:06:06 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDKTests/WXConvertTests.m | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/60cad949/ios/sdk/WeexSDKTests/WXConvertTests.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDKTests/WXConvertTests.m b/ios/sdk/WeexSDKTests/WXConvertTests.m
index d5874bd..8b33922 100644
--- a/ios/sdk/WeexSDKTests/WXConvertTests.m
+++ b/ios/sdk/WeexSDKTests/WXConvertTests.m
@@ -71,18 +71,22 @@
}
-- (void) testColor{
+- (void) testHex2Color{
UIColor *redColor = [UIColor redColor];
NSString *redString = @"#ff0000";
+ //hex2color
+ UIColor *redTestColor = [WXConvert UIColor:redString];
+ XCTAssertTrue(CGColorEqualToColor(redTestColor.CGColor, redColor.CGColor));
+}
+
+- (void) testColor2Hex{
+ UIColor *redColor = [UIColor redColor];
+ NSString *redString = @"#ff0000";
//color2hex
NSString *hexString = [WXConvert HexWithColor:redColor];
XCTAssertTrue([redString isEqualToString:hexString]);
-
- //hex2color
- UIColor *redTestColor = [WXConvert UIColor:redString];
- XCTAssertTrue(CGColorEqualToColor(redTestColor.CGColor, redColor.CGColor));
}
@end