mirror of
https://github.com/zoriya/EntityFrameworkCore.Projectables.git
synced 2026-05-30 21:34:06 +00:00
Fixed functional test
This commit is contained in:
+2
@@ -0,0 +1,2 @@
|
|||||||
|
SELECT CAST([c].[Age] AS float) / [c].[AverageLifespan] AS [LifeProgression], CAST([c].[MentalAge] AS float) / [c].[AverageLifespan] AS [MentalLifeProgression]
|
||||||
|
FROM [Cat] AS [c]
|
||||||
@@ -31,10 +31,6 @@ namespace EntityFrameworkCore.Projectables.FunctionalTests
|
|||||||
[Projectable]
|
[Projectable]
|
||||||
public double MentalLifeProgression
|
public double MentalLifeProgression
|
||||||
=> MentalAge / AverageLifespan;
|
=> MentalAge / AverageLifespan;
|
||||||
|
|
||||||
[Projectable]
|
|
||||||
public double ReservedAge
|
|
||||||
=> base.Age; // base should not affect the generated outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +40,7 @@ namespace EntityFrameworkCore.Projectables.FunctionalTests
|
|||||||
using var dbContext = new SampleDbContext<Cat>();
|
using var dbContext = new SampleDbContext<Cat>();
|
||||||
|
|
||||||
var query = dbContext.Set<Cat>()
|
var query = dbContext.Set<Cat>()
|
||||||
.Select(x => new { x.LifeProgression, x.AverageLifespan });
|
.Select(x => new { x.LifeProgression, x.MentalLifeProgression });
|
||||||
|
|
||||||
return Verifier.Verify(query.ToQueryString());
|
return Verifier.Verify(query.ToQueryString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user