Created
April 23, 2014 11:30
-
-
Save FransBouma/11211671 to your computer and use it in GitHub Desktop.
First Typed View (read only poco, mapped onto view) tests succeeding in LLBLGen Pro Linq Provider:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void TypedViewPocoTest1() | |
{ | |
using(var adapter = new DataAccessAdapter()) | |
{ | |
var metaData = new LinqMetaData(adapter); | |
var q = (from i in metaData.InvoicesPocoLinq | |
where i.Country == "USA" | |
select i) | |
.Distinct(); | |
var results = q.ToList(); | |
Assert.AreEqual(311, results.Count()); | |
foreach(var v in results) | |
{ | |
Assert.IsFalse(string.IsNullOrEmpty(v.CustomerId)); | |
} | |
} | |
} | |
[Test] | |
public void TypedViewPocoTest2() | |
{ | |
using(var adapter = new DataAccessAdapter()) | |
{ | |
var metaData = new LinqMetaData(adapter); | |
var q = (from i in metaData.InvoicesPocoLinq | |
where i.Country=="USA" | |
select new { OrderId = i.OrderId, CustomerId = i.CustomerId}) | |
.Distinct(); | |
var results = q.ToList(); | |
Assert.AreEqual(121, results.Count()); | |
foreach(var v in results) | |
{ | |
Assert.IsFalse(string.IsNullOrEmpty(v.CustomerId)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment