[Xamarin.Forms][Non-ACR] Enhance TCs for coverage 35/178335/5
authorRinaYou <rina6350.you@samsung.com>
Wed, 9 May 2018 10:33:49 +0000 (19:33 +0900)
committerRinaYou <rina6350.you@samsung.com>
Thu, 10 May 2018 06:45:26 +0000 (15:45 +0900)
Change-Id: I08d14b4420c3e413221a0621ce9b2b7fa5dbdc53
Signed-off-by: Rina You <rina6350.you@samsung.com>
tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs
tct-suite-vs/Tizen.XamarinForms2.Tests/testcase/TSColor.cs
tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSItemsViewTemplate.cs
tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSLayoutTemplate.cs
tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSPage.cs
tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSRelativeLayout.cs
tct-suite-vs/Tizen.XamarinForms4.Tests/testcase/TSResourceDictionary.cs
tct-suite-vs/Tizen.XamarinForms5.Tests/testcase/TSStackLayout.cs

index 82fa197..987bdb1 100755 (executable)
@@ -246,6 +246,35 @@ namespace Xamarin.Forms.Core.UnitTests
 
         [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<Xamarin.Forms.PlatformConfiguration.Tizen>();
+            Assert.IsInstanceOf<IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.AbsoluteLayout>>(config, "config is not AbsoluteLayout");
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Check override method OnChildAdded is invoked when its child is added.")]
         [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnChildAdded M")]
         [Property("SPEC_URL", "-")]
index 1d33336..b2155b1 100755 (executable)
@@ -291,6 +291,22 @@ namespace Xamarin.Forms.Core.UnitTests
 
         [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>(color);
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Checl value returned by FromHsla.")]
         [Property("SPEC", "Xamarin.Forms.Color.Hue")]
         [Property("SPEC_URL", "-")]
index cd58516..577fe10 100755 (executable)
@@ -20,8 +20,8 @@ using NUnit.Framework.TUnit;
 using XamarinForTizen;
 using XamarinForTizen.Tizen;
 using System.Threading.Tasks;
-using AutoTemplate;\r
-\r
+using AutoTemplate;
+
 namespace Xamarin.Forms.Core.UnitTests
 {
     [TestFixture]
index 848188b..7fbf78a 100755 (executable)
@@ -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
- */\r
-\r
-using AutoTemplate;\r
+ */
+
+using AutoTemplate;
 using NUnit.Framework;
 using NUnit.Framework.TUnit;
 using System.Threading.Tasks;
index b6a0d67..77c3767 100755 (executable)
@@ -21,7 +21,7 @@ using XamarinForTizen.Tizen;
 using XamarinForTizen;
 using System.Threading.Tasks;
 using Xamarin.Forms.Platform.Tizen.Native;
-using AutoTemplate;\r
+using AutoTemplate;
 
 namespace Xamarin.Forms.Core.UnitTests
 {
index 3f03150..239ebd6 100755 (executable)
@@ -22,7 +22,7 @@ using System.Linq.Expressions;
 using System.Threading.Tasks;
 using XamarinForTizen.Tizen;
 using XamarinForTizen;
-using AutoTemplate;\r
+using AutoTemplate;
 
 namespace Xamarin.Forms.Core.UnitTests
 {
@@ -203,6 +203,33 @@ namespace Xamarin.Forms.Core.UnitTests
 
         [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<Xamarin.Forms.PlatformConfiguration.Tizen>();\r
+            Assert.IsInstanceOf<IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.RelativeLayout>>(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.")]
         [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnAdded M")]
         [Property("SPEC_URL", "-")]
index de23a55..5ee031d 100755 (executable)
@@ -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);
+        }
     }
 }
index fd4bfe9..ee9ccfd 100755 (executable)
@@ -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<Xamarin.Forms.PlatformConfiguration.Tizen>();
+            Assert.IsInstanceOf<IPlatformElementConfiguration <Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.StackLayout>> (config, "config is not IPlatformElementConfiguration");
+        }
     }
 }