Exemple #1
0
        public void Deleteによるn通の削除(int n)
        {
            //setUp
            var max        = 10;
            var threadSpan = 0; //最小経過時間

            var mail     = new Mail();
            var mailInfo = CreateMailInfo();

            for (int i = 0; i < max; i++)
            {
                sut.Save(mail, mailInfo);
            }
            var expected = max - n;
            var list     = sut.GetList(max, threadSpan);

            //exerceise
            foreach (var l in list)
            {
                var filename = l.MailInfo.FileName;
                sut.Delete(filename);
                n--;
                if (n == 0)
                {
                    break;
                }
            }
            var actual = sut.GetList(max, threadSpan).Count;

            //verify
            Assert.That(actual, Is.EqualTo(expected));
        }