Skip to content

Commit

Permalink
SortedSet: Add move view tests.
Browse files Browse the repository at this point in the history
svn path=/trunk/mcs/; revision=155126
  • Loading branch information
harinath committed Apr 9, 2010
1 parent 195fec2 commit c78a0e1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mcs/class/System/Test/System.Collections.Generic/SortedSetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,28 @@ public void ViewGetView ()
Assert.IsTrue (view.SequenceEqual (new [] { 5 }));
}

void EmptySubView (SortedSet<int> set)
{
var view = set.GetViewBetween (-20, -15);
Assert.AreEqual (0, view.Count);
Assert.AreEqual (0, view.Min);
Assert.AreEqual (0, view.Max);

view = set.GetViewBetween (15, 20);
Assert.AreEqual (0, view.Count);
Assert.AreEqual (0, view.Min);
Assert.AreEqual (0, view.Max);
}

[Test]
public void EmptySubView ()
{
EmptySubView (new SortedSet<int> ());
EmptySubView (new SortedSet<int> { 1, 3, 5, 7, 9 });
EmptySubView (new SortedSet<int> { -40, 40 });
EmptySubView (new SortedSet<int> { -40, -10, 10, 40 });
}

[Test]
public void ViewMin ()
{
Expand Down

0 comments on commit c78a0e1

Please sign in to comment.