Пример #1
0
 public RunServer(string address)
 {
     this.machine = new AjSharpMachine(false);
     this.host = new Host(this.machine);
     this.service = new ServiceHost(this);
     BasicHttpBinding binding = new BasicHttpBinding();
     this.service.AddServiceEndpoint(typeof(IRunServer), binding, address);
     this.formatter = new BinaryFormatter();
 }
Пример #2
0
        public void EvaluateHostedExpression()
        {
            Host host = new Host(new Machine());
            Host host2 = new Host(new Machine(false));
            host.Machine.Environment.SetValue("host", host2);
            host2.Machine.Environment.SetValue("foo", "bar");
            HostedExpression expression = new HostedExpression(new VariableExpression("foo"), new VariableExpression("host"));

            object result = expression.Evaluate(host.Machine.Environment);

            Assert.AreSame(Machine.Current, host.Machine);
            Assert.AreEqual("bar", result);
            Assert.IsNull(host.Machine.Environment.GetValue("foo"));
        }
Пример #3
0
 public void Setup()
 {
     this.host = new Host(new AjSharpMachine(false));
 }
Пример #4
0
 public void Setup()
 {
     this.host = new Host();
 }