예제 #1
0
 public void ホスト名の解決に失敗している時_処理はキャンセルされる()
 {
     //setUp
     MailSave mailSave = null;
     var domainName = "";
     var interval = 10;//10分
     var synchronize = 0;
     var keepTime = 100;//100分
     //不正ホスト名 xxxxx
     var oneFetch = new OneFetch(interval, "xxxxx", 9110, "user1", "user1", "localuser", synchronize, keepTime);
     var sut = new OneFetchJob(new Kernel(), mailSave, domainName, oneFetch, 3, 1000);
     var expected = false;
     //exercise
     var actual = sut.Job(new Logger(), DateTime.Now, this);
     //verify
     Assert.That(actual, Is.EqualTo(expected));
     //tearDown
     sut.Dispose();
 }
예제 #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();
 }
예제 #3
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, "user2", "user2", "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();
 }