public void Should_Load_Int_Value_On_Stack() { var ldint = InstFactory.Ldc_I4(2); var engine = EngineFactory.CreateFor <int>(new[] { ldint }, "load"); engine.Execute("load"); Assert.AreEqual(2, engine.Process.EvalStack.Pop().Value); }
public void Should_Add_Int_Values_On_Stack() { var insts = new [] { InstFactory.Ldc_I4(2), InstFactory.Ldc_I4(2), InstFactory.Add(), InstFactory.Ret() }; var engine = EngineFactory.CreateFor <int>(insts, "add"); engine.Execute("add"); Assert.AreEqual(0, engine.Process.EvalStack.Count); Assert.AreEqual(4, engine.Process.Result.Value); }
private void SelectInstForm_Load(object sender, EventArgs e) { InstFactory instFactory = new InstFactory(); List <Inst> instList = instFactory.queryByUserById(Session.GetInstance().User.Id); this.InstListView.View = View.Details; this.InstListView.FullRowSelect = true; this.InstListView.Columns.Add("机构名称", 300, HorizontalAlignment.Left); this.InstListView.BeginUpdate(); foreach (Inst item in instList) { ListViewItem lvi = new ListViewItem(); lvi.Text = item.Name; lvi.Tag = item; this.InstListView.Items.Add(lvi); } this.InstListView.EndUpdate(); }