Browse Source

Added unit test for generating textBox.PasswordChar property.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4957 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
e9ae2efe47
  1. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs
  2. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs

@ -32,7 +32,7 @@ namespace ICSharpCode.PythonBinding @@ -32,7 +32,7 @@ namespace ICSharpCode.PythonBinding
/// </summary>
/// <remarks>
/// 1) Strings are returned surrounded by double quotes.
/// 2) Characters are returned as System.Convert.ToChar("character")
/// 2) Characters are returned surrounded by double quotes.
/// 3) Objects are returned with their full name (e.g. System.Windows.Forms.Size(100, 200)).
/// 4) Enums are returned with their full name (e.g. System.Windows.Forms.AccessibleRole.None).
/// 5) By default the ToString method is used on the property value.
@ -47,7 +47,7 @@ namespace ICSharpCode.PythonBinding @@ -47,7 +47,7 @@ namespace ICSharpCode.PythonBinding
if (propertyType == typeof(String)) {
return GetQuotedString((string)propertyValue);
} else if (propertyType == typeof(Char)) {
return "System.Convert.ToChar(" + GetQuotedString(propertyValue.ToString()) + ")";
return GetQuotedString(propertyValue.ToString());
} else if (propertyType == typeof(AnchorStyles)) {
AnchorStyles anchor = (AnchorStyles)propertyValue;
return GetAnchorStyleAsString(anchor);

6
src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs

@ -111,5 +111,11 @@ namespace PythonBinding.Tests.Designer @@ -111,5 +111,11 @@ namespace PythonBinding.Tests.Designer
{
Assert.AreEqual("None", PythonPropertyValueAssignment.ToString(null));
}
[Test]
public void CharConversion()
{
Assert.AreEqual("\"*\"", PythonPropertyValueAssignment.ToString('*'));
}
}
}

Loading…
Cancel
Save