Skip to content

Commit

Permalink
Fixed bug where empty query string caused null to be returned rather …
Browse files Browse the repository at this point in the history
…than p => false. Fixed tests to ensure null does not come back as an expression.
  • Loading branch information
EwneoN committed Nov 22, 2016
1 parent 2ef7542 commit 5773f74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Queste.Test/ErrorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class ErrorTests
[InlineData(" \n")]
[InlineData(" \r\n")]
[InlineData(null)]
public void ExpressionShouldReturnNull1(string queryString)
public void ExpressionShouldNotReturnNull1(string queryString)
{
ExpressionBuilder.BuildExpression<KeyValuePair<string, DateTime>>(queryString).Should().BeNull();
ExpressionBuilder.BuildExpression<KeyValuePair<string, DateTime>>(queryString).Should().NotBeNull();
}

[Theory]
Expand All @@ -32,9 +32,9 @@ public void ExpressionShouldReturnNull1(string queryString)
[InlineData(" \n")]
[InlineData(" \r\n")]
[InlineData(null)]
public void FunctionShouldReturnNull1(string queryString)
public void FunctionShouldNotReturnNull1(string queryString)
{
ExpressionBuilder.BuildFunction<KeyValuePair<string, DateTime>>(queryString).Should().BeNull();
ExpressionBuilder.BuildFunction<KeyValuePair<string, DateTime>>(queryString).Should().NotBeNull();
}

[Theory]
Expand Down
2 changes: 1 addition & 1 deletion Queste/ExpressionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static class ExpressionBuilder
{
if (string.IsNullOrWhiteSpace(queryString))
{
return null;
return p => false;
}

queryString = queryString.Replace("%3d", "=");
Expand Down
4 changes: 2 additions & 2 deletions Queste/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,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("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]

0 comments on commit 5773f74

Please sign in to comment.