コード例 #1
0
 public void TestPass()
 {
     Turnstile t=new Turnstile();
     t.Pass();
     Turnstile t1 =new Turnstile();
     Assert.IsTrue(t1.Alarm());
     Assert.IsTrue(t1.Locked());
 }
コード例 #2
0
 public void TestCoin()
 {
       Turnstile t=new Turnstile();
       t.Coin();
       Turnstile t1=new Turnstile();
       Assert.IsFalse(t1.Locked());
       Assert.IsFalse(t1.Alarm());
       Assert.AreEqual(1,t.Coins);
 }
コード例 #3
0
          public void TestCoinAndPass()
          {
              Turnstile t=new Turnstile();
              t.Coin();
              t.Pass();
              Turnstile t1=new Turnstile();

             Assert.IsTrue(t1.Locked());
              Assert.IsFalse(t1.Alarm());
              Assert.AreEqual(1,t1.Coins,"coins");
          }
コード例 #4
0
 public void TestCancelAlarm()
 {
     Turnstile t=new Turnstile();
     t.Pass();
     t.Coin();
     Turnstile t1 = new Turnstile();
     Assert.IsFalse(t1.Alarm());
     Assert.IsFalse(t1.Locked());
     Assert.AreEqual(1,t1.Coins);
     Assert.AreEqual(0,t1.Refunds);
 }
コード例 #5
0
 public void TestInit()
 {
     Turnstile t=new Turnstile();
     Assert.IsTrue(t.Locked());
     Assert.IsFalse(t.Alarm());
 }