Skip to content

Commit

Permalink
Revert "Fixed #53 - when parameters are assigned with an @ symbol, th…
Browse files Browse the repository at this point in the history
…ey are displayed in ToString() as a @@"

This reverts commit 7612422.
  • Loading branch information
abe545 committed Dec 1, 2015
1 parent 388d4e3 commit 064590f
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public InputOutputParameter(string name, Action<object> setter, object value, Db
Contract.Requires(!string.IsNullOrWhiteSpace(name));
Contract.Requires(setter != null);

ParameterName = name.StartsWith("@") ? name.Substring(1) : name;
ParameterName = name;
this.Value = value;
this.DbType = dbType;
this.setter = setter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class InputParameter : IInputStoredProcedureParameter
public InputParameter(string name, object value, DbType? dbType = null)
{
Value = value;
ParameterName = name.StartsWith("@") ? name.Substring(1) : name;
ParameterName = name;
DbType = dbType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public OutputParameter(string name, Action<object> setter, DbType? dbType = null
Contract.Requires(!string.IsNullOrWhiteSpace(name));
Contract.Requires(setter != null);

this.ParameterName = name.StartsWith("@") ? name.Substring(1) : name;
this.ParameterName = name;
this.setter = setter;
this.DbType = dbType;
this.Size = size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public TableValuedParameter(string name, IEnumerable values, Type valueType, str
Contract.Requires(!string.IsNullOrWhiteSpace(tableTypeName));
Contract.Requires(!string.IsNullOrWhiteSpace(tableTypeSchema));

ParameterName = name.StartsWith("@") ? name.Substring(1) : name;
ParameterName = name;
this.values = values;
this.valueType = valueType;
this.TypeName = string.Format("[{0}].[{1}]", tableTypeSchema, tableTypeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,5 @@ public void NullValueToStringReturnsCorrectString()
{
new InputOutputParameter("Foo", o => { }, null).ToString().Should().Be("[InOut] @Foo = '{null}'");
}

[TestMethod]
public void ToStringDoesNotDisplayExtraAts()
{
new InputOutputParameter("@Foo", o => { }, null).ToString().Should().Be("[InOut] @Foo = 'Bar'");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,5 @@ public void NullValueToStringReturnsCorrectString()
{
new InputParameter("Foo", null).ToString().Should().Be("@Foo = '{null}'");
}

[TestMethod]
public void ToStringDoesNotDisplayExtraAts()
{
new InputParameter("@Foo", "Bar").ToString().Should().Be("@Foo = 'Bar'");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,5 @@ public void ToStringRepresentsTheParameter()
{
new OutputParameter("Foo", o => { }).ToString().Should().Be("[Out] @Foo");
}

[TestMethod]
public void ToStringDoesNotDisplayExtraAts()
{
new OutputParameter("@Foo", o => { }).ToString().Should().Be("[Out] @Foo");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ public void ToStringRepresentsTheParameter()
.Should().Be(string.Format("@Foo = IEnumerable<{0}> (1 items)", typeof(TVP)));
}

[TestMethod]
public void ToStringDoesNotDisplayExtraAts()
{
new TableValuedParameter("@Foo", new[] { new TVP(42) }, typeof(TVP), "CustomInt", "Schema").ToString()
.Should().Be(string.Format("@Foo = IEnumerable<{0}> (1 items)", typeof(TVP)));
}

private class TVP
{
public int Int { get; set; }
Expand Down

0 comments on commit 064590f

Please sign in to comment.