File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
tests/Clave.Expressionify.Tests/DbContextExtensions Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ public static partial class TestEntityExtensions
1414 [ Expressionify ]
1515 public static bool IsFoo ( this TestEntity2 testEntity ) => testEntity . Name == "Foo" ;
1616
17+ [ Expressionify ]
18+ public static string GetFoo ( this TestEntity2 testEntity ) => "Foo " + testEntity . Name ;
19+
1720 [ Expressionify ]
1821 public static bool IsSomething ( this TestEntity testEntity ) => testEntity . Name == Name ;
1922
Original file line number Diff line number Diff line change @@ -188,11 +188,12 @@ public void UseExpressionify_EvaluationMode_DefaultsToLimitedCompatibilityButCac
188188 debugInfo [ "Expressionify:EvaluationMode" ] . ShouldBe ( ExpressionEvaluationMode . LimitedCompatibilityButCached . ToString ( ) ) ;
189189 }
190190
191- [ Test ]
192- public void UseExpressionify_InFilter ( )
191+ [ TestCase ( ExpressionEvaluationMode . FullCompatibilityButSlow ) ]
192+ [ TestCase ( ExpressionEvaluationMode . LimitedCompatibilityButCached ) ]
193+ public void UseExpressionify_InFilter ( ExpressionEvaluationMode mode )
193194 {
194- using var dbContext = new TestDbContext ( GetOptions ( o => o . WithEvaluationMode ( ExpressionEvaluationMode . LimitedCompatibilityButCached ) ) ) ;
195- var query = dbContext . TestEntities2 . Select ( e => e . Name ) ;
195+ using var dbContext = new TestDbContext ( GetOptions ( o => o . WithEvaluationMode ( mode ) ) ) ;
196+ var query = dbContext . TestEntities2 . Select ( e => e . GetFoo ( ) ) ;
196197
197198 var sql = query . ToQueryString ( ) ;
198199 sql . ShouldStartWith ( "SELECT \" t\" .\" Name\" " ) ;
You can’t perform that action at this time.
0 commit comments