コード例 #1
0
ファイル: TSTextConstants.cs プロジェクト: wonrst/TizenFX
        public void PlaceholderEquals()
        {
            tlog.Debug(tag, $"PlaceholderEquals START");

            var placeholder = new Tizen.NUI.Text.Placeholder();

            Assert.IsNotNull(placeholder, "Can't create success object strikethrough");
            Assert.IsInstanceOf <Tizen.NUI.Text.Placeholder>(placeholder, "Should be an instance of placeholder type.");

            var compare = new Tizen.NUI.Text.Placeholder();

            Assert.IsTrue(placeholder == compare, "Should be true!");
            Assert.AreEqual(placeholder.GetHashCode(), compare.GetHashCode(), "Should be true!");

            compare.Ellipsis = true;
            Assert.IsTrue(placeholder != compare, "Should be true!");

            tlog.Debug(tag, $"PlaceholderEquals END (OK)");
        }
コード例 #2
0
ファイル: TSTextEditor.cs プロジェクト: wonrst/TizenFX
        public void TextEditorGetPlaceholder()
        {
            tlog.Debug(tag, $"TextEditorGetPlaceholder START");

            var testingTarget = new TextEditor(true);

            Assert.IsNotNull(testingTarget, "Can't create success object TextEditor");
            Assert.IsInstanceOf <TextEditor>(testingTarget, "Should be an instance of TextEditor type.");

            var setPlaceholder = new Tizen.NUI.Text.Placeholder()
            {
                Text        = "placeholder text",
                TextFocused = "placeholder TextFocused",
                Color       = Color.Red,
                FontFamily  = "BreezeSans",
                FontStyle   = new Tizen.NUI.Text.FontStyle()
                {
                    Width  = FontWidthType.Expanded,
                    Weight = FontWeightType.ExtraLight,
                    Slant  = FontSlantType.Italic,
                },
                PointSize = 15.0f,
                Ellipsis  = true,
            };

            testingTarget.SetPlaceholder(setPlaceholder);

            var getPlaceholder = testingTarget.GetPlaceholder();

            Assert.AreEqual(getPlaceholder.Text, setPlaceholder.Text, "Should be equal!");
            Assert.AreEqual(getPlaceholder.TextFocused, setPlaceholder.TextFocused, "Should be equal!");
            Assert.AreEqual(true, CheckColor(getPlaceholder.Color, setPlaceholder.Color), "Should be true!");
            Assert.AreEqual(getPlaceholder.FontFamily, setPlaceholder.FontFamily, "Should be equal!");
            Assert.AreEqual(true, getPlaceholder.FontStyle == setPlaceholder.FontStyle, "Should be true!");
            Assert.AreEqual(getPlaceholder.PointSize, setPlaceholder.PointSize, "Should be equal!");
            Assert.AreEqual(getPlaceholder.Ellipsis, setPlaceholder.Ellipsis, "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextEditorGetPlaceholder END (OK)");
        }