From: RinaYou Date: Wed, 9 May 2018 10:33:49 +0000 (+0900) Subject: [Xamarin.Forms][Non-ACR] Enhance TCs for coverage X-Git-Tag: public_m1_final~50^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F178335%2F5;p=test%2Ftct%2Fcsharp%2Fapi.git [Xamarin.Forms][Non-ACR] Enhance TCs for coverage Change-Id: I08d14b4420c3e413221a0621ce9b2b7fa5dbdc53 Signed-off-by: Rina You --- diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs index 82fa197f7..987bdb1b5 100755 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs +++ b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs @@ -244,6 +244,35 @@ namespace Xamarin.Forms.Core.UnitTests Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag YProportional is not correct."); } + [Test] + [Category("P1")] + [Description("Check whether on method works properly or not.")] + [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.On M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] + public void On_METHOD() + { + /**TEST CODE**/ + var mAbsoluteLayout = new SubAbsoluteLayout() + { + Children = + { + new Label() { + Text = "My Tex", + FontSize = 12 + }, + new Button() + { + Text = "My Button", + BorderColor = new Color(0,0,0,0) + } + } + }; + var config = mAbsoluteLayout.On(); + Assert.IsInstanceOf>(config, "config is not AbsoluteLayout"); + } + [Test] [Category("P1")] [Description("Check override method OnChildAdded is invoked when its child is added.")] diff --git a/tct-suite-vs/Tizen.XamarinForms2.Tests/testcase/TSColor.cs b/tct-suite-vs/Tizen.XamarinForms2.Tests/testcase/TSColor.cs index 1d33336b5..b2155b129 100755 --- a/tct-suite-vs/Tizen.XamarinForms2.Tests/testcase/TSColor.cs +++ b/tct-suite-vs/Tizen.XamarinForms2.Tests/testcase/TSColor.cs @@ -289,6 +289,22 @@ namespace Xamarin.Forms.Core.UnitTests Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color."); } + [Test] + [Category("P1")] + [Description("check whether FormUint method works properly or not.")] + [Property("SPEC", "Xamarin.Forms.Color.FromHsla M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] + public void FromUnit_COLOR_RETURN() + { + Random rd = new Random(); + int num = rd.Next(1, 255); + var color = Color.FromUint((uint)num); + Assert.IsNotNull(color, "This object is not null"); + Assert.IsInstanceOf(color); + } + [Test] [Category("P1")] [Description("Checl value returned by FromHsla.")] diff --git a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSItemsViewTemplate.cs b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSItemsViewTemplate.cs index cd5851626..577fe1051 100755 --- a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSItemsViewTemplate.cs +++ b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSItemsViewTemplate.cs @@ -20,8 +20,8 @@ using NUnit.Framework.TUnit; using XamarinForTizen; using XamarinForTizen.Tizen; using System.Threading.Tasks; -using AutoTemplate; - +using AutoTemplate; + namespace Xamarin.Forms.Core.UnitTests { [TestFixture] diff --git a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSLayoutTemplate.cs b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSLayoutTemplate.cs index 848188b9a..7fbf78a5b 100755 --- a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSLayoutTemplate.cs +++ b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSLayoutTemplate.cs @@ -12,9 +12,9 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License - */ - -using AutoTemplate; + */ + +using AutoTemplate; using NUnit.Framework; using NUnit.Framework.TUnit; using System.Threading.Tasks; diff --git a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSPage.cs b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSPage.cs index b6a0d6790..77c3767de 100755 --- a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSPage.cs +++ b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSPage.cs @@ -21,7 +21,7 @@ using XamarinForTizen.Tizen; using XamarinForTizen; using System.Threading.Tasks; using Xamarin.Forms.Platform.Tizen.Native; -using AutoTemplate; +using AutoTemplate; namespace Xamarin.Forms.Core.UnitTests { diff --git a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSRelativeLayout.cs b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSRelativeLayout.cs index 3f03150a2..239ebd655 100755 --- a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSRelativeLayout.cs +++ b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSRelativeLayout.cs @@ -22,7 +22,7 @@ using System.Linq.Expressions; using System.Threading.Tasks; using XamarinForTizen.Tizen; using XamarinForTizen; -using AutoTemplate; +using AutoTemplate; namespace Xamarin.Forms.Core.UnitTests { @@ -201,6 +201,33 @@ namespace Xamarin.Forms.Core.UnitTests Assert.IsTrue(getChildren.Contains(label2), "RelativeLayout should contains child view that added"); } + [Test] + [Category("P1")] + [Description("Check whether on method works properly or not.")] + [Property("SPEC", "Xamarin.Forms.RelativeLayout.On M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] + public void On_METHOD() + { + var label1 = new Label() + { + Text = "label1 test", + TextColor = new Color(0.1, 0, 0.2), + FontSize = 10 + }; + var label2 = new Label() + { + Text = "label2 test", + TextColor = new Color(0.1, 0.2, 0.3), + FontSize = 10 + }; + _relativeLayout.Children.Add(label1, Constraint.Constant(0), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100)); + _relativeLayout.Children.Add(label2, Constraint.Constant(100), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100)); + var config = _relativeLayout.On(); + Assert.IsInstanceOf>(config, "config is not RelativeLayout"); + } + [Test] [Category("P1")] [Description("Check whether OnAdded() is called after after a view is added to relative layout or not.")] diff --git a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSResourceDictionary.cs b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSResourceDictionary.cs index de23a5513..5ee031d7f 100755 --- a/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSResourceDictionary.cs +++ b/tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSResourceDictionary.cs @@ -330,5 +330,22 @@ namespace Xamarin.Forms.Core.UnitTestss var getType = resourceDic.MergedWith; Assert.AreEqual(type, getType, "Set and get value of MergedWith is not correct"); } + + [Test] + [Category("P1")] + [Description("Check whether MergedDictionaries works properly")] + [Property("SPEC", "Xamarin.Forms.ResourceDictionary.MergedDictionaries A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] + public void MergedDictionaries_SET_GET() + { + var rd = new ResourceDictionary(); + rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar11" } }); + rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar12" } }); + rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar13" } }); + + Assert.AreNotEqual(0, rd.MergedDictionaries.Count); + } } } diff --git a/tct-suite-vs/Tizen.XamarinForms5.Tests/testcase/TSStackLayout.cs b/tct-suite-vs/Tizen.XamarinForms5.Tests/testcase/TSStackLayout.cs index fd4bfe9cb..ee9ccfdf5 100755 --- a/tct-suite-vs/Tizen.XamarinForms5.Tests/testcase/TSStackLayout.cs +++ b/tct-suite-vs/Tizen.XamarinForms5.Tests/testcase/TSStackLayout.cs @@ -194,5 +194,26 @@ namespace Xamarin.Forms.Core.UnitTests await Task.Delay(500); } + [Test] + [Category("P1")] + [Description("Check whether on method works properly or not.")] + [Property("SPEC", "Xamarin.Forms.StackLayout.On M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] + public void On_METHOD() + { + var subStackLayout = new CustomStackLayout(); + var label = new Label() + { + Text = "Label Test" + }; + ContentPage mContentPage = new ContentPage + { + Content = subStackLayout + }; + var config = subStackLayout.On(); + Assert.IsInstanceOf> (config, "config is not IPlatformElementConfiguration"); + } } }