Exemplo n.º 1
0
        public void TextMapHelperGetUnderlineMap()
        {
            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap START");

            var underline = new Tizen.NUI.Text.Underline()
            {
                Enable = true,
                Color  = new Color("#3498DB"),
                Height = 2.0f
            };

            using (PropertyMap map = TextMapHelper.GetUnderlineMap(underline))
            {
                var color = new Color();
                map.Find(0, "enable").Get(out bool enable);
                map.Find(0, "color").Get(color);
                map.Find(0, "height").Get(out float height);

                Assert.AreEqual(enable, underline.Enable, "Should be equal!");
                Assert.AreEqual(height, underline.Height, "Should be equal!");
                Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
                color.Dispose();
            }

            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap END (OK)");
        }
Exemplo n.º 2
0
        public void TextMapHelperGetUnderlineMap()
        {
            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap START");

            var underline = new Tizen.NUI.Text.Underline()
            {
                Enable = true,
                Color  = new Color("#3498DB"),
                Height = 2.0f
            };

            var map   = TextMapHelper.GetUnderlineMap(underline);
            var color = new Color();

            map.Find(0, "enable").Get(out bool enable);
            map.Find(0, "color").Get(color);
            map.Find(0, "height").Get(out float height);

            Assert.AreEqual(enable, underline.Enable, "Should be equal!");
            Assert.AreEqual(height, underline.Height, "Should be equal!");
            Assert.AreEqual(color.R, underline.Color.R, "Should be equal!");
            Assert.AreEqual(color.G, underline.Color.G, "Should be equal!");
            Assert.AreEqual(color.B, underline.Color.B, "Should be equal!");
            Assert.AreEqual(color.A, underline.Color.A, "Should be equal!");

            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap END (OK)");
        }
Exemplo n.º 3
0
        public void TextMapHelperGetUnderlineMap()
        {
            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap START");

            var underline = new Tizen.NUI.Text.Underline()
            {
                Enable    = true,
                Color     = new Color("#3498DB"),
                Height    = 2.0f,
                Type      = UnderlineType.Solid,
                DashWidth = 5.0f,
                DashGap   = 3.0f,
            };

            using (PropertyMap map = TextMapHelper.GetUnderlineMap(underline))
            {
                var color = new Color();
                map.Find(0, "enable").Get(out bool enable);
                map.Find(0, "color").Get(color);
                map.Find(0, "height").Get(out float height);
                map.Find(0, "type").Get(out int type);
                map.Find(0, "dashWidth").Get(out float dashWidth);
                map.Find(0, "dashGap").Get(out float dashGap);

                Assert.AreEqual(enable, underline.Enable, "Should be equal!");
                Assert.AreEqual(height, underline.Height, "Should be equal!");
                Assert.AreEqual(true, CheckColor(color, underline.Color), "Should be true!");
                Assert.AreEqual(type, (int)underline.Type, "Should be equal!");
                Assert.AreEqual(dashWidth, underline.DashWidth, "Should be equal!");
                Assert.AreEqual(dashGap, underline.DashGap, "Should be equal!");

                color.Dispose();
            }

            tlog.Debug(tag, $"TextMapHelperGetUnderlineMap END (OK)");
        }