Exemple #1
0
        public void AddInstructionToDesktop()
        {
            NoOp ins = new NoOp();

            Assert.IsNotNull(ins, "Instruction not created.");
            m_dsk.Add(ins);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
		public Instruction AddNamedInstruction(string name)
		{
			NoOp ins = new NoOp();
			Assert.IsNotNull(ins,"Instruction "+name+" not created.");
			m_ts.AddNamedInstruction(name,ins);
			return ins;
		}
Exemple #4
0
        public Instruction AddNamedInstruction(string name)
        {
            NoOp ins = new NoOp();

            Assert.IsNotNull(ins, "Instruction " + name + " not created.");
            m_ts.AddNamedInstruction(name, ins);
            return(ins);
        }
Exemple #5
0
		public void DataRefDefaulted()
		{
			TestState ts = TestState.getOnly("LT");
			ts.Script = "MessageTest.xml";
			NoOp nop1 = new NoOp();
			nop1.Data = 123;
			ts.AddNamedInstruction("niceId",nop1);
			NoOp nop2 = new NoOp();
			nop2.Data = 456;
			ts.AddNamedInstruction("greatId",nop2);
			Message message = new Message();
			message.AddText("Let's count, '");
			message.AddDataRef("$niceId",nop1);
			message.AddText("' and '");
			message.AddDataRef("$greatId.data",nop2);
			message.AddText("' to see it work!");
			string result = message.Read();
			Assert.AreEqual("Let's count, '123' and '456' to see it work!",result,"Message not relayed intact!");
		}
Exemple #6
0
        public void DataRefDefaulted()
        {
            TestState ts = TestState.getOnly("LT");

            ts.Script = "MessageTest.xml";
            NoOp nop1 = new NoOp();

            nop1.Data = 123;
            ts.AddNamedInstruction("niceId", nop1);
            NoOp nop2 = new NoOp();

            nop2.Data = 456;
            ts.AddNamedInstruction("greatId", nop2);
            Message message = new Message();

            message.AddText("Let's count, '");
            message.AddDataRef("$niceId", nop1);
            message.AddText("' and '");
            message.AddDataRef("$greatId.data", nop2);
            message.AddText("' to see it work!");
            string result = message.Read();

            Assert.AreEqual("Let's count, '123' and '456' to see it work!", result, "Message not relayed intact!");
        }
Exemple #7
0
		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);
		}