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)); }
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")))); }
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)); }
public void Check(object systemUnderTest, TypedValue actualValue, Tree <Cell> expectedCell) { processor.Execute( ExecuteContext.Make(ExecuteCommand.Check, systemUnderTest, actualValue), ExecuteParameters.Make(expectedCell)); }
public bool Compare(TypedValue actual, Tree <Cell> expectedCell) { return((bool)processor.Execute( ExecuteContext.Make(ExecuteCommand.Compare, actual), ExecuteParameters.Make(expectedCell)).Value); }
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))); }
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[]")))); }
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("")))); }