public void Specifying_an_event_activity()
        {
            _claim   = new ClaimAdjustmentInstance();
            _machine = AutomatonymousStateMachine <ClaimAdjustmentInstance>
                       .New(builder => builder
                            .State("Running", out Running)
                            .Event("Create", out Create)
                            .InstanceState(x => x.CurrentState)
                            .During(builder.Initial)
                            .When(Create, b => b
                                  .Execute(context => new CalculateValueActivity(new LocalCalculator()))
                                  .Execute(context => new ActionActivity <ClaimAdjustmentInstance>(x => { }))
                                  .TransitionTo(Running)
                                  )
                            );

            var data = new CreateClaim
            {
                X = 56,
                Y = 23,
            };

            _machine.RaiseEvent(_claim, Create, data)
            .Wait();
        }
示例#2
0
        public void Should_capture_the_value()
        {
            var data = new CreateClaim
            {
                X = 56,
                Y = 23,
            };

            Assert.That(async() => await _machine.RaiseEvent(_claim, _machine.Create, data), Throws.TypeOf <EventExecutionException>());

            Assert.AreEqual(default, _claim.Value);
示例#3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ClaimCreationModel cla = new ClaimCreationModel();

            // cla.kp_claimname = TextBox1.Text;
            cla.kp_claim        = TextBox1.Text;
            cla.kp_claimcontact = new Guid(HttpContext.Current.Request.Cookies[1].Value);
            cla.kp_claimpolicy  = new Guid(DropDownList1.SelectedValue);

            CreateClaim creation = new CreateClaim();

            creation.ClaimCreate(cla);
        }
        public void Specifying_an_event_activity()
        {
            _claim   = new ClaimAdjustmentInstance();
            _machine = new InstanceStateMachine();

            var data = new CreateClaim
            {
                X = 56,
                Y = 23,
            };

            _machine.RaiseEvent(_claim, _machine.Create, data);
        }
示例#5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ClaimCreationModel cla = new ClaimCreationModel();

            // cla.kp_claimname = TextBox1.Text;
            cla.kp_claim        = TextBox1.Text;
            cla.kp_claimcontact = new Guid(HttpContext.Current.Request.Cookies.Get("UserID").Value);
            cla.kp_claimpolicy  = new Guid(DropDownList1.SelectedValue);

            CreateClaim creation = new CreateClaim();

            creation.ClaimCreate(cla);
            Response.Redirect("PolicyDisplay.aspx");
        }