Exemplo n.º 1
0
        public void Test05_SortedDictionary()
        {
            SortedDictionary <DateTime, decimal> testSortedDict = new SortedDictionary <DateTime, decimal>();

            DateTime key1 = DateTime.Today;
            DateTime key2 = DateTime.Today.AddMonths(-7);
            DateTime key3 = new DateTime(2020, 1, 1, 13, 2, 3);

            testSortedDict.Add(key1, 1000);
            testSortedDict.Add(key2, 767);
            testSortedDict.Add(key3, -6143);

            Assert.AreEqual(false, testSortedDict.AddIfNotContains(key3, 121));
            Assert.AreEqual(3, testSortedDict.Count);
        }