Beispiel #1
0
        public void TestAddInstruction()
        {
            var testAddOper = new AddOper();

            testAddOper.Number = 3;
            var testApply = new ApplyOper();

            testApply.Number = 4;

            var testInstructions = new List <InstructionBase>();

            testInstructions.Add(testAddOper);
            testInstructions.Add(testApply);
            var testCalculator = new Calculator(testInstructions);

            Assert.AreEqual(7, testCalculator.Calculate());
        }
Beispiel #2
0
        /// <summary>
        /// 克隆函数实现
        /// </summary>
        /// <returns></returns>
        public new SanApplyMain Clone()
        {
            SanApplyMain sanApplyMain = base.Clone() as SanApplyMain;

            sanApplyMain.StoreBase = StoreBase.Clone();

            sanApplyMain.ApplyOper = ApplyOper.Clone();

            sanApplyMain.AppoveOper = AppoveOper.Clone();

            sanApplyMain.ReturnOper = ReturnOper.Clone();

            sanApplyMain.ReturnAPPOper = ReturnAPPOper.Clone();

            sanApplyMain.StopOper = StopOper.Clone();

            return(sanApplyMain);
        }