TypedValue Execute(Tree <Cell> targetCell)
        {
            var parameters = new ExecuteParameters(
                ExecuteParameters.Make(new CellTreeLeaf(memberName), new CellTree(), targetCell));

            return(execute.Execute(new ExecuteContext(ExecuteCommand.Invoke, target), parameters));
        }
        [Test] public void LastActionIsSetAsExpectedCellAttribute()
        {
            SetUpSUT("procedure");
            var parameters = new ExecuteParameters(
                ExecuteParameters.Make(new CellTreeLeaf("procedure"), new CellTree(), targetCell));

            execute.Execute(new ExecuteContext(ExecuteCommand.Check, target.Value), parameters);
            Assert.AreEqual("blah blah", targetCell.Value.GetAttribute(CellAttribute.Extension));
        }
Exemple #3
0
 public void MatchesErrorKeyword()
 {
     Assert.IsTrue(IsMatch(ExecuteCommand.Check, new ExecuteError(), ExecuteParameters.Make(TestUtils.CreateCell("error"))));
     Assert.IsFalse(IsMatch(ExecuteCommand.Input, new ExecuteError(), ExecuteParameters.MakeMemberCell(TestUtils.CreateCell("stuff"), TestUtils.CreateCell("error"))));
 }
Exemple #4
0
 public void Check(object systemUnderTest, Tree <Cell> memberName, Tree <Cell> parameters, Tree <Cell> expectedCell)
 {
     processor.Execute(
         ExecuteContext.Make(ExecuteCommand.Check, systemUnderTest),
         ExecuteParameters.Make(memberName, parameters, expectedCell));
 }
Exemple #5
0
 public void Check(object systemUnderTest, TypedValue actualValue, Tree <Cell> expectedCell)
 {
     processor.Execute(
         ExecuteContext.Make(ExecuteCommand.Check, systemUnderTest, actualValue),
         ExecuteParameters.Make(expectedCell));
 }
Exemple #6
0
 public bool Compare(TypedValue actual, Tree <Cell> expectedCell)
 {
     return((bool)processor.Execute(
                ExecuteContext.Make(ExecuteCommand.Compare, actual),
                ExecuteParameters.Make(expectedCell)).Value);
 }
Exemple #7
0
 public TypedValue TryInvoke(object target, Tree <Cell> memberName, Tree <Cell> parameters, Tree <Cell> targetCell)
 {
     return(processor.Execute(
                ExecuteContext.Make(ExecuteCommand.Invoke, new TypedValue(target)),
                ExecuteParameters.Make(memberName, parameters, targetCell)));
 }
Exemple #8
0
        public void TestRegisterAndGet()
        {
            Assert.IsTrue(IsMatch("<<xyz"));
            Assert.IsFalse(TestUtils.IsMatch(ExecuteCommand.Check, new ExecuteSymbolSave(), ExecuteParameters.Make(TestUtils.CreateCell("x<<yz"))));
            Assert.IsFalse(IsMatch("x<<yz"));
            Assert.IsTrue(TestUtils.IsMatch(ExecuteCommand.Check, new ExecuteSymbolSave(), ExecuteParameters.Make(TestUtils.CreateCell(">>xyz"))));
            Assert.IsFalse(TestUtils.IsMatch(ExecuteCommand.Input, new ExecuteSymbolSave(), ExecuteParameters.MakeMemberCell(TestUtils.CreateCell("stuff"), TestUtils.CreateCell(">>xyz"))));
            Assert.IsFalse(TestUtils.IsMatch(ExecuteCommand.Check, new ExecuteSymbolSave(), ExecuteParameters.Make(TestUtils.CreateCell("x>>yz"))));
            Assert.IsFalse(IsMatch("x>>yz"));

            Assert.IsFalse(TestUtils.IsMatch(ExecuteCommand.Input, new ExecuteSymbolSave(), ExecuteParameters.MakeMemberCell(TestUtils.CreateCell("stuff"), TestUtils.CreateCell("error"))));
        }
 public void TestMatch()
 {
     Assert.IsTrue(IsMatch(ExecuteCommand.Check, new ExecuteException(), ExecuteParameters.Make(TestUtils.CreateCell("exception[]"))));
     Assert.IsTrue(IsMatch(ExecuteCommand.Check, new ExecuteException(), ExecuteParameters.Make(TestUtils.CreateCell("exception[NullPointerException]"))));
     Assert.IsFalse(IsMatch(ExecuteCommand.Input, new ExecuteException(), ExecuteParameters.MakeMemberCell(TestUtils.CreateCell("stuff"), TestUtils.CreateCell("exception[]"))));
 }
Exemple #10
0
 public void TestMatch()
 {
     Assert.IsTrue(IsMatch(ExecuteCommand.Check, new ExecuteEmpty(), ExecuteParameters.Make(TestUtils.CreateCell(""))));
     Assert.IsTrue(IsMatch(ExecuteCommand.Input, new ExecuteEmpty(), ExecuteParameters.MakeMemberCell(TestUtils.CreateCellRange("stuff"), TestUtils.CreateCell(""))));
 }