Esempio n. 1
0
        public void 接続のみの確認()
        {
            //setUp
            MailSave mailSave    = null;
            var      domainName  = "";
            var      interval    = 10;  //10分
            var      synchronize = 0;
            var      keepTime    = 100; //100分
            var      oneFetch    = new OneFetch(interval, "127.0.0.1", 9110, "user1", "user1", "localuser", synchronize, keepTime);
            var      sut         = new OneFetchJob(new Kernel(), mailSave, domainName, oneFetch, 3, 1000);
            var      expected    = true;
            //exercise
            var actual = sut.Job(new Logger(), DateTime.Now, this);

            //verify
            Assert.That(actual, Is.EqualTo(expected));
            //tearDown
            sut.Dispose();
        }
Esempio n. 2
0
        public void インターバルが10分の時_5分後の処理はキャンセルされる()
        {
            //setUp
            MailSave mailSave    = null;
            var      domainName  = "";
            var      interval    = 10;  //10分
            var      synchronize = 0;
            var      keepTime    = 100; //100分
            var      oneFetch    = new OneFetch(interval, "127.0.0.1", 9110, "user1", "user1", "localuser", synchronize, keepTime);
            var      sut         = new OneFetchJob(new Kernel(), mailSave, domainName, oneFetch, 3, 1000);
            var      expected    = false;

            //exercise
            //1回目の接続
            sut.Job(new Logger(), DateTime.Now, this);
            //2回目(5分後)の接続
            var actual = sut.Job(new Logger(), DateTime.Now.AddMinutes(5), this);

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