Esempio n. 1
0
        public void Builder_01ThreadNextNode_Test()
        {
            PowerThreadDescription    description = new PowerThreadDescription();
            PowerThreadBuilderForTest builder     = new PowerThreadBuilderForTest(Guid.NewGuid(), "test thread", description);
            var thread = builder.Build();

            PrintThreadCurrentNode(thread);


            RoleSettings roleSettings             = new RoleSettings();
            Dictionary <string, string> varialbes = new Dictionary <string, string>();

            thread.StartWith(roleSettings, varialbes);

            PrintThreadCurrentNode(thread);


            thread.GoNextNode(thread.CurrentNode);
            PrintThreadCurrentNode(thread);


            thread.GoNextNode(thread.CurrentNode);
            PrintThreadCurrentNode(thread);

            thread.GoNextNode(thread.CurrentNode);
            PrintThreadCurrentNode(thread);

            thread.GoNextNode(thread.CurrentNode);
            PrintThreadCurrentNode(thread);
            //  thread.TerminateThreadAtNode(thread.CurrentNode);
        }
Esempio n. 2
0
        public void Builder_05SinkAndEmerge_Test()
        {
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                Formatting = Newtonsoft.Json.Formatting.Indented,

                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
            };


            Guid ThreadObjectId = Guid.Parse("a44dacf8-ffc4-485d-9eb9-d9693304e276");

            PowerThreadDescription    description = new PowerThreadDescription();
            PowerThreadBuilderForTest builder     =
                new PowerThreadBuilderForTest(ThreadObjectId, "test thread", description);
            var thread = builder.Build();


            PrintThreadCurrentNode(thread);



            RoleSettings roleSettings             = new RoleSettings();
            Dictionary <string, string> varialbes = new Dictionary <string, string>();

            thread.StartWith(roleSettings, varialbes);

            var t  = JsonConvert.SerializeObject(thread.CurrentNode.DefaultForm.BindingViewModel);
            var tt = JsonConvert.DeserializeObject <PowerThreadEntity>(t);

            var s = thread.Sink();



            var threadRevived = builder.BuildFromSink(thread.Id, s);

            PrintThreadCurrentNodePage(threadRevived);

            threadRevived.CurrentNode.DefaultForm.Go();
            PrintThreadCurrentNodePage(threadRevived);

            thread.CurrentNode.DefaultForm.Go();
            PrintThreadCurrentNodePage(thread);

            thread.CurrentNode.DefaultForm.Go();
            PrintThreadCurrentNodePage(thread);
        }
Esempio n. 3
0
        public void Builder_03RenderForm_Test()
        {
            PowerThreadDescription    description = new PowerThreadDescription();
            PowerThreadBuilderForTest builder     = new PowerThreadBuilderForTest(Guid.NewGuid(), "test thread", description);
            var thread = builder.Build();

            PrintThreadCurrentNode(thread);


            RoleSettings roleSettings             = new RoleSettings();
            Dictionary <string, string> varialbes = new Dictionary <string, string>();

            thread.StartWith(roleSettings, varialbes);
            PrintThreadCurrentNode(thread);

            var html = thread.CurrentNode.DefaultForm.RenderHtml();
            //  var html2 = thread.CurrentNode.RenderPage();
        }
 public BasePowerThreadBuilder(PowerThreadDescription powerThreadDescription, Guid objectId, string name)
 {
     this.PowerThreadDescription = powerThreadDescription;
     this.ObjectId = objectId;
     this.Name     = name;
 }
 public PowerThreadBuilderForTest(Guid objectId, string name, PowerThreadDescription powerThreadDescription)
     : base(powerThreadDescription, objectId, name)
 {
 }