Exemplo n.º 1
0
        public void FailsOnDecayTooLarge()
        {
            RegeneratingBank bank = new RegeneratingBank {
                Quantity  = 4,
                DecayRate = 5,
            };
            bool worked = false;

            bank.Decay(() => worked = true);
            Assert.IsTrue(worked);
        }
Exemplo n.º 2
0
        public void DecayWorks()
        {
            RegeneratingBank bank = new RegeneratingBank {
                Quantity  = 4,
                DecayRate = 2
            };

            bank.Decay(onFailure: () => {
                Assert.Fail("Not enough energy. Something is wrong with the Quantity.");
            });
            Assert.IsTrue(bank == 2);
        }