}
/// <summary>
- /// Specify primary cursor (caret) position in text control.
+ /// PrimaryCursorPosition property.<br />
+ /// Specify the position of the primary cursor (caret) in text control.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <remarks>
+ /// If the value set is out of range (negative or greater than or equal the number of characters in Text) then the PrimaryCursorPosition is moved to the end of Text (the number of characters in Text).
+ /// </remarks>
+ /// <since_tizen> 10 </since_tizen>
public int PrimaryCursorPosition
{
get
}
/// <summary>
- /// Specify primary cursor (caret) position in text control.
+ /// PrimaryCursorPosition property.<br />
+ /// Specify the position of the primary cursor (caret) in text control.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <remarks>
+ /// If the value set is out of range (negative or greater than or equal the number of characters in Text) then the PrimaryCursorPosition is moved to the end of Text (the number of characters in Text).
+ /// </remarks>
+ /// <since_tizen> 10 </since_tizen>
public int PrimaryCursorPosition
{
get
[Property("SPEC", "Tizen.NUI.TextEditor.PrimaryCursorPosition A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "bowon.ryu@samsung.com")]
+ [Property("AUTHOR", "s.sabah@samsung.com")]
public void TextEditorPrimaryCursorPosition()
{
tlog.Debug(tag, $"TextEditorPrimaryCursorPosition START");
Assert.IsNotNull(testingTarget, "Can't create success object TextEditor");
Assert.IsInstanceOf<TextEditor>(testingTarget, "Should be an instance of TextEditor type.");
- testingTarget.Text = "0123456789";
- testingTarget.PrimaryCursorPosition = 5;
- Assert.AreEqual(5, testingTarget.PrimaryCursorPosition, "Should be equal!");
+ testingTarget.Text ="Hello World!";
+ int textLen = testingTarget.Text.Length;
+
+ int expectedValue = textLen;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 5;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 0;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = textLen ;
+ testingTarget.PrimaryCursorPosition = textLen + 1;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 6;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = textLen ;
+ testingTarget.PrimaryCursorPosition = -1;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
testingTarget.Dispose();
tlog.Debug(tag, $"TextEditorPrimaryCursorPosition END (OK)");
}
+
[Test]
[Category("P1")]
[Description("TextEditor EnableSelection.")]
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")]
+ [Property("AUTHOR", "s.sabah@samsung.com")]
public void TextFieldPrimaryCursorPosition()
{
tlog.Debug(tag, $"TextFieldPrimaryCursorPosition START");
Assert.IsNotNull(testingTarget, "Can't create success object TextField");
Assert.IsInstanceOf<TextField>(testingTarget, "Should be an instance of TextField type.");
- testingTarget.Text = "0123456789";
- testingTarget.PrimaryCursorPosition = 5;
- Assert.AreEqual(5, testingTarget.PrimaryCursorPosition, "Should be equal!");
+ testingTarget.Text ="Hello World!";
+ int textLen = testingTarget.Text.Length;
+
+ int expectedValue = textLen;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 5;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 0;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = textLen ;
+ testingTarget.PrimaryCursorPosition = textLen + 1;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = 6;
+ testingTarget.PrimaryCursorPosition = expectedValue;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
+
+ expectedValue = textLen ;
+ testingTarget.PrimaryCursorPosition = -1;
+ Assert.AreEqual(expectedValue, testingTarget.PrimaryCursorPosition, "Should be equal!");
testingTarget.Dispose();
tlog.Debug(tag, $"TextFieldPrimaryCursorPosition END (OK)");