From 3f94fd006e17ae772d74a4ab2d0769db18e4872b Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Wed, 13 Apr 2022 17:01:02 +0900 Subject: [PATCH] [NUI] add property testcase for Text component added testcase for missing property of text component MinLineSize, EnableSelection, EnableGrabHandle, EnableGrabHandlePopup, GrabHandleColor, EnableEditing, PrimaryCursorPosition Signed-off-by: Bowon Ryu --- .../testcase/public/BaseComponents/TSTextEditor.cs | 169 +++++++++++++++++++++ .../testcase/public/BaseComponents/TSTextField.cs | 48 ++++++ .../testcase/public/BaseComponents/TSTextLabel.cs | 22 +++ 3 files changed, 239 insertions(+) diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextEditor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextEditor.cs index 2464d43..f9cbb12 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextEditor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextEditor.cs @@ -571,5 +571,174 @@ namespace Tizen.NUI.Devel.Tests testingTarget.Dispose(); tlog.Debug(tag, $"TextEditorGetPlaceholder END (OK)"); } + + [Test] + [Category("P1")] + [Description("TextEditor MinLineSize.")] + [Property("SPEC", "Tizen.NUI.TextEditor.MinLineSize A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorMinLineSize() + { + tlog.Debug(tag, $"TextEditorMinLineSize START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.MinLineSize = 20; + Assert.AreEqual(20, testingTarget.MinLineSize, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorMinLineSize END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor EnableEditing.")] + [Property("SPEC", "Tizen.NUI.TextEditor.EnableEditing A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorEnableEditing() + { + tlog.Debug(tag, $"TextEditorEnableEditing START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.EnableEditing = false; + Assert.AreEqual(false, testingTarget.EnableEditing, "Should be equal!"); + + testingTarget.EnableEditing = true; + Assert.AreEqual(true, testingTarget.EnableEditing, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorEnableEditing END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor PrimaryCursorPosition.")] + [Property("SPEC", "Tizen.NUI.TextEditor.PrimaryCursorPosition A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorPrimaryCursorPosition() + { + tlog.Debug(tag, $"TextEditorPrimaryCursorPosition START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.Text = "0123456789"; + testingTarget.PrimaryCursorPosition = 5; + Assert.AreEqual(5, testingTarget.PrimaryCursorPosition, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorPrimaryCursorPosition END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor EnableSelection.")] + [Property("SPEC", "Tizen.NUI.TextEditor.EnableSelection A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorEnableSelection() + { + tlog.Debug(tag, $"TextEditorEnableSelection START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.EnableSelection = true; + Assert.AreEqual(true, testingTarget.EnableSelection, "Should be equal!"); + + testingTarget.EnableSelection = false; + Assert.AreEqual(false, testingTarget.EnableSelection, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorEnableSelection END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor EnableGrabHandle.")] + [Property("SPEC", "Tizen.NUI.TextEditor.EnableGrabHandle A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorEnableGrabHandle() + { + tlog.Debug(tag, $"TextEditorEnableGrabHandle START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.EnableGrabHandle = true; + Assert.AreEqual(true, testingTarget.EnableGrabHandle, "Should be equal!"); + + testingTarget.EnableGrabHandle = false; + Assert.AreEqual(false, testingTarget.EnableGrabHandle, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorEnableGrabHandle END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor EnableGrabHandlePopup.")] + [Property("SPEC", "Tizen.NUI.TextEditor.EnableGrabHandlePopup A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorEnableGrabHandlePopup() + { + tlog.Debug(tag, $"TextEditorEnableGrabHandlePopup START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.EnableGrabHandlePopup = true; + Assert.AreEqual(true, testingTarget.EnableGrabHandlePopup, "Should be equal!"); + + testingTarget.EnableGrabHandlePopup = false; + Assert.AreEqual(false, testingTarget.EnableGrabHandlePopup, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorEnableGrabHandlePopup END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextEditor GrabHandleColor.")] + [Property("SPEC", "Tizen.NUI.TextEditor.GrabHandleColor A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextEditorGrabHandleColor() + { + tlog.Debug(tag, $"TextEditorGrabHandleColor START"); + + var testingTarget = new TextEditor(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextEditor"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextEditor type."); + + testingTarget.GrabHandleColor = new Color(1.0f, 1.0f, 0.8f, 0.0f); + var color = new Color(1.0f, 1.0f, 0.8f, 0.0f); + Assert.AreEqual(true, CheckColor(color, testingTarget.GrabHandleColor), "Should be true!"); + + color.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TextEditorGrabHandleColor END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextField.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextField.cs index 47741fd..0dbec04 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextField.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextField.cs @@ -2253,5 +2253,53 @@ namespace Tizen.NUI.Devel.Tests testingTarget.Dispose(); tlog.Debug(tag, $"TextFieldGetPlaceholder END (OK)"); } + + [Test] + [Category("P1")] + [Description("TextField EnableEditing.")] + [Property("SPEC", "Tizen.NUI.TextField.EnableEditing A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextFieldEnableEditing() + { + tlog.Debug(tag, $"TextFieldEnableEditing START"); + + var testingTarget = new TextField(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextField"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextField type."); + + testingTarget.EnableEditing = false; + Assert.AreEqual(false, testingTarget.EnableEditing, "Should be equal!"); + + testingTarget.EnableEditing = true; + Assert.AreEqual(true, testingTarget.EnableEditing, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextFieldEnableEditing END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TextField PrimaryCursorPosition.")] + [Property("SPEC", "Tizen.NUI.TextField.PrimaryCursorPosition A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextFieldPrimaryCursorPosition() + { + tlog.Debug(tag, $"TextFieldPrimaryCursorPosition START"); + + var testingTarget = new TextField(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextField"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextField type."); + + testingTarget.Text = "0123456789"; + testingTarget.PrimaryCursorPosition = 5; + Assert.AreEqual(5, testingTarget.PrimaryCursorPosition, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextFieldPrimaryCursorPosition END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextLabel.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextLabel.cs index 96d52b6..5951d8a 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextLabel.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/BaseComponents/TSTextLabel.cs @@ -333,5 +333,27 @@ namespace Tizen.NUI.Devel.Tests testingTarget.Dispose(); tlog.Debug(tag, $"TextLabelGetTextFit END (OK)"); } + + [Test] + [Category("P1")] + [Description("TextLabel MinLineSize.")] + [Property("SPEC", "Tizen.NUI.TextLabel.MinLineSize A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "bowon.ryu@samsung.com")] + public void TextLabelMinLineSize() + { + tlog.Debug(tag, $"TextLabelMinLineSize START"); + + var testingTarget = new TextLabel(true); + Assert.IsNotNull(testingTarget, "Can't create success object TextLabel"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TextLabel type."); + + testingTarget.MinLineSize = 20; + Assert.AreEqual(20, testingTarget.MinLineSize, "Should be equal!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TextLabelMinLineSize END (OK)"); + } } } -- 2.7.4