コード例 #1
0
        public void If_Cable_Have_Charge_And_Call_Tick_Method_Then_DelayPoint_Will_Increased_By_One()
        {
            Mock <IHumanPlayer> humanmock     = new Mock <IHumanPlayer>();
            Mock <IChargeble>   chargeblemock = new Mock <IChargeble>();
            ICable cable = new Cable(chargeblemock.Object)
            {
                ChargeOwner = humanmock.Object
            };
            int befortick = cable.DelayPoint;

            cable.Tick();
            Assert.That(cable.DelayPoint == befortick + 1);
        }
コード例 #2
0
        public void If_Charged_Cable_Ticked_Delay_Times_Then_It_Will_Give_The_Charge_To_The_Next_Cable()
        {
            Mock <IHumanPlayer> humanmock     = new Mock <IHumanPlayer>();
            Mock <IChargeble>   chargeblemock = new Mock <IChargeble>();
            ICable cable1 = new Cable(chargeblemock.Object);
            ICable cable2 = new Cable(cable1)
            {
                ChargeOwner = humanmock.Object
            };

            for (int i = 0; i < Cable.Delaystatic; i++)
            {
                cable2.Tick();
            }

            Assert.That(cable2.ChargeOwner == null);
            Assert.That(cable1.ChargeOwner == humanmock.Object);
        }