コード例 #1
0
    public void Clear_Empty()
    {
        var list = new SortingListDictionary <WrappedInt, string>();

        list.Clear();
        Assert.Empty(list);
    }
コード例 #2
0
    public void Factory_Wrap_AssumeSorted()
    {
        var list = SortingListDictionary <WrappedInt, string> .Factory_Wrap_AssumeSorted(
            TypicalSortedKeys(),
            TypicalSortedValues());

        Assert.Equal(TypicalCount, list.Count);
        Assert.True(Typical().SequenceEqual(list));
    }
コード例 #3
0
    public void Factory_Wrap_AssumeSorted_But_Not()
    {
        var badInts = new int[] { 4, 2, 5 };
        var list    = SortingListDictionary <int, string> .Factory_Wrap_AssumeSorted(
            new List <int>(badInts),
            TypicalSortedValues());

        Assert.Equal(badInts.Length, list.Count);
        Assert.True(badInts.SequenceEqual(list.Keys));
        Assert.True(TypicalSortedValues().SequenceEqual(list.Values));
    }
コード例 #4
0
 public SortingListDictionary <WrappedInt, string> Typical()
 {
     return(SortingListDictionary <WrappedInt, string> .Factory_Wrap_AssumeSorted(
                TypicalSortedKeys(),
                TypicalSortedValues()));
 }
コード例 #5
0
    public void ContainsKey_Empty()
    {
        var list = new SortingListDictionary <int, string>();

        Assert.False(list.ContainsKey(4));
    }
コード例 #6
0
    public void IndexOf_Empty()
    {
        var list = new SortingListDictionary <int, string>();

        Assert.Equal(-1, list.IndexOf(4));
    }