Esempio n. 1
0
        public void Process(
            Definition.Process definition,
            string trace,
            bool pass
            )
        {
            IExecutionService service = new ExecutionService();
            var process = definition.New(null);

            service.Execute(process);

            var index = 0;

            foreach (var c in trace)
            {
                var input = process.Processes
                            .OfType <LabelledInput <char> >()
                            .FirstOrDefault(
                    i =>
                    i.Label == c &&
                    i.Status == Status.AwaitIO);

                if (index == trace.Length - 1 && !pass)
                {
                    Assert.That(input, Is.Null);
                }

                else
                {
                    Assert.That(input, Is.Not.Null);
                    input.ExecuteInput(service);
                }
                index++;
            }
        }
Esempio n. 2
0
 protected IO(
     Definition.Process definition,
     Process parent
     )
     : base(
         definition,
         parent)
 {
 }
Esempio n. 3
0
        protected Process(
            Definition.Process definition,
            Process parent
            )
            : base(Guid.NewGuid())
        {
            Definition = definition;
            Parent     = parent;

            if (Parent == null)
            {
                Processes      = new List <Process>();
                UltimateParent = this;
            }
            else
            {
                UltimateParent = Parent.UltimateParent;
            }

            UltimateParent.Processes.Add(this);
        }