예제 #1
0
 public void TestPass()
 {
     Turnstile t = new Turnstile();
     t.Pass();
     //Turnstile t1 = new Turnstile();
     Assert.IsTrue(t.Alarm());
     Assert.IsTrue(t.Locked());
 }
예제 #2
0
 public void TestCoin()
 {
     Turnstile t = new Turnstile();
     t.Coin();
     //Turnstile t1 = new Turnstile();
     Assert.IsFalse(t.Locked());
     Assert.IsFalse(t.Alarm());
     Assert.AreEqual(1, t.Coins);
 }
예제 #3
0
 public void TestTwoCoins()
 {
     Turnstile t = new Turnstile();
     t.Coin();
     t.Coin();
     Assert.IsFalse(t.Locked());
     Assert.AreEqual(1, t.Coins);
     Assert.AreEqual(1, t.Refunds);
     Assert.IsFalse(t.Alarm());
 }
예제 #4
0
        public void TestCoinAndPass()
        {
            Turnstile t = new Turnstile();
            t.Coin();
            t.Pass();
            //Turnstile t1 = new Turnstile();

            Assert.IsTrue(t.Locked());
            Assert.IsFalse(t.Alarm());
            //Assert.AreEqual(1, t1.Coins, "coins");
        }
예제 #5
0
 public void TestTwoOperations()
 {
     Turnstile t = new Turnstile();
     t.Coin();
     t.Pass();
     t.Coin();
     //Turnstile t1 = new Turnstile();
     Assert.IsFalse(t.Locked());
     Assert.AreEqual(2, t.Coins);
     t.Pass();
     Assert.IsTrue(t.Locked());
 }
예제 #6
0
        public void Init()
        {
            Turnstile t = new Turnstile();
            t.Reset();

        }
예제 #7
0
 public void TestInit()
 {
     Turnstile t = new Turnstile();
     Assert.IsTrue(t.Locked());
     Assert.IsFalse(t.Alarm());
 }