public void PassFailContext(string PassIn, string FailIn, out string onPass, out string onFail) { // Set up a typical instruction tree. TestState ts = TestState.getOnly("LT"); NoOp op1 = new NoOp(); NoOp op2 = new NoOp(); NoOp op3 = new NoOp(); Desktop Desk = new Desktop(); Desk.Add(op1); op1.Parent = Desk; Desk.Add(op2); op2.Parent = Desk; Desk.Add(op3); op3.Parent = Desk; ApplicationContext ac = MakeAppContext(); ts.AddNamedInstruction("Find me", ac); ApplicationContext AppCon = new ApplicationContext(); AppCon.SetSource("Find me"); Assert.AreEqual(ac, (ApplicationContext)AppCon.TestGetOfSource(), "Context source not set right"); Desk.Add(AppCon); NoOp ins1 = new NoOp(); NoOp ins2 = new NoOp(); NoOp ins3 = new NoOp(); AppCon.Add(ins1); ins1.Parent = AppCon; AppCon.Add(ins2); ins2.Parent = AppCon; AppCon.Add(ins3); ins3.Parent = AppCon; ins2.PassFailInContext(PassIn, FailIn, out onPass, out onFail); }
public void AddInstructionToDesktop() { NoOp ins = new NoOp(); Assert.IsNotNull(ins, "Instruction not created."); m_dsk.Add(ins); }
public void PassFailAncestorContext(string PassIn, string FailIn, out string onPass, out string onFail) { // Set up a typical instruction tree. TestState ts = TestState.getOnly("LT"); ts.Script = "ApplicationContextTest.xml"; NoOp op1 = new NoOp(); NoOp op2 = new NoOp(); NoOp op3 = new NoOp(); Desktop Desk = new Desktop(); Desk.OnPass = PassIn; Desk.OnFail = FailIn; Desk.Add(op1); op1.Parent = Desk; Desk.Add(op2); op2.Parent = Desk; Desk.Add(op3); op3.Parent = Desk; ApplicationContext ac = MakeAppContext(); ts.AddNamedInstruction("Find me",ac); ApplicationContext AppCon = new ApplicationContext(); AppCon.SetSource("Find me"); Assert.AreEqual(ac,(ApplicationContext)AppCon.TestGetOfSource(),"Context source not set right"); Desk.Add(AppCon); AppCon.Parent = Desk; NoOp ins1 = new NoOp(); NoOp ins2 = new NoOp(); NoOp ins3 = new NoOp(); AppCon.Add(ins1); ins1.Parent = AppCon; AppCon.Add(ins2); ins2.Parent = AppCon; AppCon.Add(ins3); ins3.Parent = AppCon; ins2.PassFailInContext(null,null,out onPass,out onFail); }