예제 #1
0
        public void TestFormattingNonSequentialUids()
        {
            UniqueId[] uids = new UniqueId[] {
                new UniqueId(1), new UniqueId(3), new UniqueId(5),
                new UniqueId(7), new UniqueId(9)
            };
            string expect = "1,3,5,7,9";
            string actual;

            actual = ImapUtils.FormatUidSet(uids);
            Assert.AreEqual(expect, actual, "Formatting a non-sequential list of uids.");
        }
예제 #2
0
        public void TestFormattingSimpleUidRange()
        {
            UniqueId[] uids = new UniqueId[] {
                new UniqueId(1), new UniqueId(2), new UniqueId(3),
                new UniqueId(4), new UniqueId(5), new UniqueId(6),
                new UniqueId(7), new UniqueId(8), new UniqueId(9)
            };
            string expect = "1:9";
            string actual;

            actual = ImapUtils.FormatUidSet(uids);
            Assert.AreEqual(expect, actual, "Formatting a simple range of uids failed.");
        }
예제 #3
0
        public void TestFormattingComplexSetOfUids()
        {
            UniqueId[] uids = new UniqueId[] {
                new UniqueId(1), new UniqueId(2), new UniqueId(3),
                new UniqueId(5), new UniqueId(6), new UniqueId(9),
                new UniqueId(10), new UniqueId(11), new UniqueId(12),
                new UniqueId(15), new UniqueId(19), new UniqueId(20)
            };
            string expect = "1:3,5:6,9:12,15,19:20";
            string actual;

            actual = ImapUtils.FormatUidSet(uids);
            Assert.AreEqual(expect, actual, "Formatting a complex list of uids.");
        }
예제 #4
0
        public void TestFormattingReversedUids()
        {
            UniqueId[] uids =
            {
                new UniqueId(20), new UniqueId(19), new UniqueId(15),
                new UniqueId(12), new UniqueId(11), new UniqueId(10),
                new UniqueId(9),  new UniqueId(6),  new UniqueId(5),
                new UniqueId(3),  new UniqueId(2),  new UniqueId(1)
            };
            const string expect = "20:19,15,12:9,6:5,3:1";
            string       actual;

            actual = ImapUtils.FormatUidSet(uids);
            Assert.AreEqual(expect, actual, "Formatting a complex list of uids.");
        }