Skip to content

Commit

Permalink
minor bug when remote value is empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
goenning committed Oct 24, 2014
1 parent fd29ca7 commit 8041469
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/base/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0")]
[assembly: AssemblyFileVersion("2.0.0")]
[assembly: AssemblyVersion("2.0.1")]
[assembly: AssemblyFileVersion("2.0.1")]
3 changes: 3 additions & 0 deletions src/base/RfcValueMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public virtual object FromRemoteValue(Type type, object value)
if (type.IsEnum)
return this.ConvertToEnum(type, value);

if (type.Equals(typeof(string)))
return value == null ? "" : value.ToString();

if (value == null || value.ToString().Equals(""))
{
if (type.IsNullable())
Expand Down
6 changes: 6 additions & 0 deletions tests/Mapper/AbapValueMapperFromRemoteTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public AbapValueMapperFromRemoteTestData()
new object[] { true, typeof(Boolean), "X" },
new object[] { false, typeof(Boolean), " " },
new object[] { false, typeof(Boolean), "" },

new object[] { "", typeof(string), "" },
new object[] { "", typeof(string), null },
new object[] { " ", typeof(string), " " },
new object[] { "abc", typeof(string), "abc" },
new object[] { "A@b2", typeof(string), "A@b2" },

new object[] { "My Name is", typeof(String), "My Name is" },
new object[] { 1, typeof(int), "0001" },
Expand Down

0 comments on commit 8041469

Please sign in to comment.