Пример #1
0
        public void Run_FailTest()
        {
            IFOp       op   = new IFOp(null, null);
            MockOpData data = new MockOpData()
            {
                _itemCount = 0
            };

            bool b = op.Run(data, out string error);

            Assert.False(b);
            Assert.Equal(Err.OpNotEnoughItems, error);
        }
Пример #2
0
        public void RunTest(IOperation[] main, IOperation[] other, byte[] popData, bool checkRes, bool runResult, string expErr)
        {
            MockOpData data = new MockOpData(FuncCallName.Pop)
            {
                _itemCount = 1,
                conditionalBoolCheckResult   = checkRes,
                expectedConditionalBoolBytes = popData,
                popData = new byte[][] { popData }
            };

            IFOp op = new IFOp(main, other);
            bool b  = op.Run(data, out string error);

            Assert.Equal(runResult, b);
            Assert.Equal(expErr, error);
        }