Skip to content

Instantly share code, notes, and snippets.

@FransBouma
Created April 23, 2014 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FransBouma/11211671 to your computer and use it in GitHub Desktop.
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:
[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