[NUI][TCSACR-181]Add VisualMaps revising testcase 80/190180/4
authorxb.teng <xb.teng@samsung.com>
Fri, 28 Sep 2018 02:55:41 +0000 (10:55 +0800)
committerxb.teng <xb.teng@samsung.com>
Fri, 28 Sep 2018 07:31:51 +0000 (15:31 +0800)
Change-Id: I86c9d6ec9155000a0a714b1cbd8f7486352dac03

tct-suite-vs/Tizen.NUI.Tests/testcase/TSColorVisual.cs
tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageVisual.cs
tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextVisual.cs
tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualMap.cs

index ce8d11e..3bd6091 100755 (executable)
@@ -59,5 +59,23 @@ namespace Tizen.NUI.Tests
             Assert.AreEqual(1.0f, colorVisualMap.Color.B, "Retrieved Color.B should be equal to set value");
             Assert.AreEqual(1.0f, colorVisualMap.Color.A, "Retrieved Color.A should be equal to set value");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test RenderIfTransparent. Check whether RenderIfTransparent is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.ColorVisual.RenderIfTransparent A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void RenderIfTransparent_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            ColorVisual colorVisualMap = new ColorVisual();
+            colorVisualMap.RenderIfTransparent = true;
+            Assert.AreEqual(true, colorVisualMap.RenderIfTransparent, "Retrieved RenderIfTransparent should be equal to set value");
+
+            colorVisualMap.RenderIfTransparent = false;
+            Assert.AreEqual(false, colorVisualMap.RenderIfTransparent, "Retrieved RenderIfTransparent should be equal to set value");
+        }
     }
 }
index 58ff25e..9520a8c 100755 (executable)
@@ -315,5 +315,23 @@ namespace Tizen.NUI.Tests
             map.LoadPolicy = LoadPolicyType.Immediate;
             Assert.AreEqual(LoadPolicyType.Immediate, map.LoadPolicy, "Retrieved LoadPolicy should be equal to set value");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Atlasing. Check whether Atlasing is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.ImageVisual.Atlasing A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void Atlasing_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            ImageVisual map = new ImageVisual();
+            map.Atlasing = true;
+            Assert.AreEqual(true, map.Atlasing, "Retrieved Atlasing should be equal to set value");
+
+            map.Atlasing = false;
+            Assert.AreEqual(false, map.Atlasing, "Retrieved Atlasing should be equal to set value");
+        }
     }
 }
index 80f315f..d7148ad 100755 (executable)
@@ -193,5 +193,134 @@ namespace Tizen.NUI.Tests
             textVisualMap.EnableMarkup = true;
             Assert.AreEqual(true, textVisualMap.EnableMarkup, "Retrieved EnableMarkup should be equal to set value");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Shadow. Check whether Shadow is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.TextVisual.Shadow A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void Shadow_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            TextVisual textVisualMap = new TextVisual();
+            PropertyMap shadowMapSet = new PropertyMap();
+            shadowMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f)));
+            shadowMapSet.Add("offset", new PropertyValue(new Vector2(2.0f, 1.0f)));
+            shadowMapSet.Add("blurRadius", new PropertyValue(3.0f));
+            textVisualMap.Shadow = shadowMapSet;
+
+            PropertyMap shadowMapGet = new PropertyMap();
+            shadowMapGet = textVisualMap.Shadow;
+            Assert.IsNotNull(shadowMapGet, "Should not be null");
+            Color color = new Color();
+            shadowMapGet["color"].Get(color);
+            Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value");
+            Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value");
+            Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value");
+            Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value");
+
+            Vector2 vector2 = new Vector2();
+            shadowMapGet["offset"].Get(vector2);
+            Assert.AreEqual(2.0f, vector2.X, "Retrieved vector2.X should be equal to set value");
+            Assert.AreEqual(1.0f, vector2.Y, "Retrieved vector2.Y should be equal to set value");
+
+            float blurRadius;
+            shadowMapGet["blurRadius"].Get(out blurRadius);
+            Assert.AreEqual(3.0f, blurRadius, "Retrieved blurRadius should equals to the set value");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Underline. Check whether Underline is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.TextVisual.Underline A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void Underline_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            TextVisual textVisualMap = new TextVisual();
+            PropertyMap underlineMapSet = new PropertyMap();
+            underlineMapSet.Add("enable", new PropertyValue("true"));
+            underlineMapSet.Add("color", new PropertyValue("green"));
+            underlineMapSet.Add("height", new PropertyValue("1"));
+            textVisualMap.Underline = underlineMapSet;
+
+            PropertyMap underlineMapGet = new PropertyMap();
+            underlineMapGet = textVisualMap.Underline;
+            Assert.IsNotNull(underlineMapGet, "Should not be null");
+            string str = "";
+            underlineMapGet["enable"].Get(out str);
+            Assert.AreEqual("true", str, "Retrieved enable should equals to the set value");
+            underlineMapGet["color"].Get(out str);
+            Assert.AreEqual("green", str, "Retrieved color should equals to the set value");
+            underlineMapGet["height"].Get(out str);
+            Assert.AreEqual("1", str, "Retrieved height should equals to the set value");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Outline. Check whether Outline is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.TextVisual.Outline A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.comm")]
+        public void Outline_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            TextVisual textVisualMap = new TextVisual();
+            PropertyMap outlineMapSet = new PropertyMap();
+            outlineMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f)));
+            outlineMapSet.Add("width", new PropertyValue("1"));
+            textVisualMap.Outline = outlineMapSet;
+
+            PropertyMap outlineMapGet = new PropertyMap();
+            outlineMapGet = textVisualMap.Outline;
+            Assert.IsNotNull(outlineMapGet, "Should not be null");
+
+            Color color = new Color();\r
+            outlineMapGet["color"].Get(color);
+            Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value");
+            Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value");
+            Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value");
+            Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value");
+
+            string str = "";
+            outlineMapGet["width"].Get(out str);
+            Assert.AreEqual("1", str, "Retrieved width should equals to the set value");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Background. Check whether Background is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.TextVisual.Background A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.comm")]
+        public void Background_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            TextVisual textVisualMap = new TextVisual();
+            PropertyMap backgroundMapSet = new PropertyMap();
+            backgroundMapSet.Add("enable", new PropertyValue(true));
+            backgroundMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f)));
+            textVisualMap.Background = backgroundMapSet;
+
+            PropertyMap backgroundMapGet = new PropertyMap();
+            backgroundMapGet = textVisualMap.Background;
+            Assert.IsNotNull(backgroundMapGet, "Should not be null");
+            bool enable = false;
+            backgroundMapGet["enable"].Get(out enable);
+            Assert.AreEqual(true, enable, "Retrieved enable should equals to the set value");
+
+            Color color = new Color();
+            backgroundMapGet["color"].Get(color);
+            Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value");
+            Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value");
+            Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value");
+            Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value");
+        }
     }
 }
index 1b0b813..102bbb4 100755 (executable)
@@ -370,5 +370,23 @@ namespace Tizen.NUI.Tests
             PropertyMap map = visualMap.OutputVisualMap;
             Assert.IsNotNull(map, "Should not be null");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test VisualFittingMode. Check whether VisualFittingMode is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.VisualMap.VisualFittingMode A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void VisualFittingMode_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            VisualMap visualMap = new VisualMap();
+            visualMap.VisualFittingMode = VisualFittingModeType.Fill;
+            Assert.AreEqual(VisualFittingModeType.Fill, visualMap.VisualFittingMode, "Retrieved VisualFittingMode should be equal to set value");
+
+            visualMap.VisualFittingMode = VisualFittingModeType.FitKeepAspectRatio;
+            Assert.AreEqual(VisualFittingModeType.FitKeepAspectRatio, visualMap.VisualFittingMode, "Retrieved VisualFittingMode should be equal to set value");
+        }
     }
 }