Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Jan 28, 2024
1 parent 95f9120 commit 6b23e69
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//$Authors = Jiri Cincura ([email protected])

using System.Linq;
using System.Threading.Tasks;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
Expand All @@ -31,6 +32,13 @@ public FunkyDataQueryFbTest(FunkyDataQueryFbFixture fixture)
: base(fixture)
{ }

[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task String_contains_on_argument_with_wildcard_column(bool async)
{
return base.String_contains_on_argument_with_wildcard_column(async);
}

public class FunkyDataQueryFbFixture : FunkyDataQueryFixtureBase
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,20 @@ public override Task Correlated_collection_with_groupby_with_complex_grouping_ke
return base.Correlated_collection_with_groupby_with_complex_grouping_key_not_projecting_identifier_column_with_group_aggregate_in_final_projection(async);
}

[NotSupportedByProviderTheory]
[MemberData(nameof(IsAsyncData))]
public override Task DateTimeOffset_to_unix_time_milliseconds(bool async)
{
return base.DateTimeOffset_to_unix_time_milliseconds(async);
}

[NotSupportedByProviderTheory]
[MemberData(nameof(IsAsyncData))]
public override Task DateTimeOffset_to_unix_time_seconds(bool async)
{
return base.DateTimeOffset_to_unix_time_seconds(async);
}

[Theory(Skip = "NETProvider#1008")]
[MemberData(nameof(IsAsyncData))]
public override Task Where_TimeOnly_IsBetween(bool async)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ public SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadO
new[] { true, true },
typeof(int)),
_fbSqlExpressionFactory.Constant(0));
return patternExpression is SqlConstantExpression sqlConstantExpression
var matchingExpression = patternExpression is SqlConstantExpression sqlConstantExpression
? ((string)sqlConstantExpression.Value)?.Length == 0
? (SqlExpression)_fbSqlExpressionFactory.Constant(true)
: positionExpression
: (SqlExpression)positionExpression
: _fbSqlExpressionFactory.OrElse(
positionExpression,
_fbSqlExpressionFactory.Equal(
_fbSqlExpressionFactory.Function("CHAR_LENGTH", new[] { patternExpression }, true, new[] { true }, typeof(int)),
_fbSqlExpressionFactory.Constant(0)));
return _fbSqlExpressionFactory.AndAlso(matchingExpression, _fbSqlExpressionFactory.AndAlso(_fbSqlExpressionFactory.IsNotNull(instance), _fbSqlExpressionFactory.IsNotNull(patternExpression)));
}
}

0 comments on commit 6b23e69

Please sign in to comment.