From 00c01bd7caeae287a3f7815f1c54044276d3269a Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 26 Jul 2020 21:18:35 +0700 Subject: [PATCH] Rename `ColorAPI.ParseText()` into `.Parse()` --- sources/Color/ColorAPI.uc | 2 +- sources/Color/Tests/TEST_ColorAPI.uc | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sources/Color/ColorAPI.uc b/sources/Color/ColorAPI.uc index 6a72cb0..e292c16 100644 --- a/sources/Color/ColorAPI.uc +++ b/sources/Color/ColorAPI.uc @@ -629,7 +629,7 @@ public final function bool ParseString( * If parsed color did not specify alpha component - 255 will be used. * @return `true` if parsing was successful and false otherwise. */ -public final function bool ParseText( +public final function bool Parse( Text textWithColor, out Color resultingColor) { diff --git a/sources/Color/Tests/TEST_ColorAPI.uc b/sources/Color/Tests/TEST_ColorAPI.uc index fc21a3d..d8c2d72 100644 --- a/sources/Color/Tests/TEST_ColorAPI.uc +++ b/sources/Color/Tests/TEST_ColorAPI.uc @@ -431,37 +431,37 @@ protected static function SubTest_ParseText() { local Color expectedColor, resultColor; expectedColor = _().color.RGBA(154, 255, 0, 187); - Issue("`ParseText()` cannot parse hex colors."); - TEST_ExpectTrue(_().color.ParseText(_().text.FromString("#9aff00"), + Issue("`Parse()` cannot parse hex colors."); + TEST_ExpectTrue(_().color.Parse(_().text.FromString("#9aff00"), resultColor)); TEST_ExpectTrue(_().color.AreEqual(resultColor, expectedColor)); - Issue("`ParseText()` cannot parse rgb colors."); - TEST_ExpectTrue(_().color.ParseText(_().text.FromString("rgb(154,255,0)"), + Issue("`Parse()` cannot parse rgb colors."); + TEST_ExpectTrue(_().color.Parse(_().text.FromString("rgb(154,255,0)"), resultColor)); TEST_ExpectTrue(_().color.AreEqual(resultColor, expectedColor)); - Issue("`ParseText()` cannot parse rgba colors."); - TEST_ExpectTrue(_().color.ParseText( + Issue("`Parse()` cannot parse rgba colors."); + TEST_ExpectTrue(_().color.Parse( _().text.FromString("rgba(154,255,0,187)"), resultColor)); TEST_ExpectTrue(_().color.AreEqualWithAlpha(resultColor, expectedColor)); - Issue("`ParseText()` cannot parse rgb colors with tags."); - TEST_ExpectTrue(_().color.ParseText( + Issue("`Parse()` cannot parse rgb colors with tags."); + TEST_ExpectTrue(_().color.Parse( _().text.FromString("rgb(r=154,g=255,b=0)"), resultColor)); TEST_ExpectTrue(_().color.AreEqual(resultColor, expectedColor)); - Issue("`ParseText()` cannot parse rgba colors with tags."); - TEST_ExpectTrue(_().color.ParseText( + Issue("`Parse()` cannot parse rgba colors with tags."); + TEST_ExpectTrue(_().color.Parse( _().text.FromString("rgba(r=154,g=255,b=0,a=187)"), resultColor)); TEST_ExpectTrue(_().color.AreEqualWithAlpha(resultColor, expectedColor)); - Issue("`ParseText()` reports success when parsing invalid color string."); - TEST_ExpectFalse(_().color.ParseText( _().text.FromString("#9aff0g"), - resultColor)); + Issue("`Parse()` reports success when parsing invalid color string."); + TEST_ExpectFalse(_().color.Parse( _().text.FromString("#9aff0g"), + resultColor)); } protected static function SubTest_ParseRaw()