Esempio n. 1
0
        private void Reciever()
        {
            if (networkUnit != null && networkUnit.IsWork)
            {
                Request request = new Request(networkUnit.Recieve());

                workCore.Run(request);
            }
        }
Esempio n. 2
0
        public void CoreTest()
        {
            var commandExample  = new SummCommand();
            var builderExample  = new ResponseBuilder();
            var pipelineExample = new CommandResponsePipeline();

            RequestWorker workerExample = new RequestWorker("summ", pipelineExample, commandExample, builderExample);

            RequestWorkerSet workerSet = new RequestWorkerSet();

            workerSet.AddRequestWorkers(workerExample);

            WorkCore core = new WorkCore(workerSet);

            core.Run("summ:10,20");

            Assert.AreEqual("30", commandExample.Work().GetObject <string>(VALUE_VARIABLE_NAME));
            Assert.AreEqual("30", builderExample.GetResponse().Value);
        }