public void TestTwoOperations()
        {
            Turnstile t = new Turnstile();

            t.Coin();
            t.Pass();
            t.Coin();
            Assert.IsFalse(t.Locked(), "unlocked");
            Assert.AreEqual(2, t.Coins, "coins");
            t.Pass();
            Assert.IsTrue(t.Locked(), "locked");
        }
Ejemplo n.º 2
0
        public void Coin_OtherInstanceIsLocked_ReturnFalse()
        {
            t.Coin();
            Turnstile t1 = new Turnstile();

            Assert.That(t1.Locked(), Is.False);
        }
Ejemplo n.º 3
0
        public void Pass_OtherInstanceIsLocked_ReturnTrue()
        {
            t.Pass();
            Turnstile t1 = new Turnstile();

            Assert.That(t1.Locked(), Is.True);
        }
        public void TestInit()
        {
            Turnstile t = new Turnstile();

            Assert.IsTrue(t.Locked());
            Assert.IsFalse(t.Alarm());
        }
Ejemplo n.º 5
0
        public void TwoCoins_OtherInstanceIsLocked_ReturnFalse()
        {
            t.Coin();
            t.Coin();
            Turnstile t1 = new Turnstile();

            Assert.That(t1.Locked(), Is.False, "unlocked");
        }
        public void TestPass()
        {
            Turnstile t = new Turnstile();

            t.Pass();

            Turnstile t1 = new Turnstile();

            Assert.IsTrue(t1.Alarm(), "alarm");
            Assert.IsTrue(t1.Locked(), "locked");
        }
        public void TestCoin()
        {
            Turnstile t = new Turnstile();

            t.Coin();
            Turnstile t1 = new Turnstile();

            Assert.IsFalse(t1.Locked());
            Assert.IsFalse(t1.Alarm());
            Assert.AreEqual(1, t1.Coins);
        }
        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");
        }
        public void TestCancelAlarm()
        {
            Turnstile t = new Turnstile();

            t.Pass();
            t.Coin();

            Turnstile t1 = new Turnstile();

            Assert.IsFalse(t1.Alarm(), "alarm");
            Assert.IsFalse(t1.Locked(), "locked");
            Assert.AreEqual(1, t1.Coins, "coin");
            Assert.AreEqual(0, t1.Refunds, "refund");
        }
        public void TestTwoCoins()
        {
            Turnstile t = new Turnstile();

            t.Coin();
            t.Coin();

            Turnstile t1 = new Turnstile();

            Assert.IsFalse(t1.Locked(), "unlocked");
            Assert.AreEqual(1, t1.Coins, "coins");
            Assert.AreEqual(1, t1.Refunds, "refunds");
            Assert.IsFalse(t1.Alarm());
        }
Ejemplo n.º 11
0
 public void Init_IsLocked_ReturnTrue()
 {
     Assert.That(t.Locked(), Is.True);
 }