Skip to content

Commit d1a9bfb

Browse files
committed
Added SQL CE test for Distinct
1 parent 1cb71aa commit d1a9bfb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

0 Bytes
Binary file not shown.

Simple.Data.SqlCe40Test/NorthwindTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,17 @@ public void QueryShouldRunAfterALikeQuery()
3232
var products = db.Products.FindAll(db.Products.CategoryId == 4);
3333
Assert.Pass();
3434
}
35+
36+
[Test]
37+
public void DistinctShouldReturnDistinctList()
38+
{
39+
var db = Database.OpenFile(DatabasePath);
40+
List<string> countries = db.Customers.All()
41+
.Select(db.Customers.Country)
42+
.Distinct()
43+
.ToScalarList<string>();
44+
45+
Assert.AreEqual(countries.Distinct().Count(), countries.Count);
46+
}
3547
}
3648
}

0 commit comments

Comments
 (0)