Skip to content

Commit

Permalink
Added order by descending kihon
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlin Liles committed Mar 26, 2011
1 parent c414a5d commit 63796a0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Squire/Framework/LinqKihonStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,29 @@ public void Order_the_list_by_the_something_property_test()
Assert.AreEqual(list[1], item.LastOrDefault());
}


[TestMethod]
public void Order_the_list_by_the_something_property_descending_test()
{
//arrange
var product = new Product() { Something = 2 };
var list = new List<Product>()
{
product,
new Product(){Something = 1}
};



//act
IEnumerable<Product> item = Order_the_list_by_the_something_property_descending(list);

//assert
Assert.AreEqual(list[1], item.FirstOrDefault());
Assert.AreEqual(list[0], item.LastOrDefault());
}

protected abstract IEnumerable<Product> Order_the_list_by_the_something_property_descending(List<Product> list);
protected abstract IEnumerable<Product> Order_the_list_by_the_something_property(List<Product> list);
protected abstract IEnumerable<Product> Filter_the_products_where_something_is_equal_to_2_from_list(List<Product> list);
protected abstract IEnumerable<int> Select_the_Something_property_from_list(List<Product> list);
Expand Down
5 changes: 5 additions & 0 deletions src/Squire/LinqKihon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ protected override IEnumerable<int> Select_the_Something_property_from_list(List
throw new NotImplementedException();
}

protected override IEnumerable<Product> Order_the_list_by_the_something_property_descending(List<Product> list)
{
throw new NotImplementedException();
}

protected override IEnumerable<Product> Order_the_list_by_the_something_property(List<Product> list)
{
throw new NotImplementedException();
Expand Down

0 comments on commit 63796a0

Please sign in to comment.