Exemplo n.º 1
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            SampleRule rule   = new SampleRule();
            Sample     entity = EntityGet();

            rule.RDelete(entity);
        }
Exemplo n.º 2
0
        public void HandleClosing(CancelEventArgs args)
        {
            if (OrderProcessing.IsModified)
            {
                switch (MessageBox.Show("Save changes to the Sample Data?", "Saving changes", MessageBoxButton.YesNoCancel, MessageBoxImage.Question))
                {
                case MessageBoxResult.Cancel:
                    args.Cancel = true;
                    return;

                case MessageBoxResult.Yes:
                    OrderProcessing.Save();
                    break;
                }
            }

            if (SampleRule.IsModified)
            {
                switch (MessageBox.Show("Save changes to the Sample Rule?", "Saving changes", MessageBoxButton.YesNoCancel, MessageBoxImage.Question))
                {
                case MessageBoxResult.Cancel:
                    args.Cancel = true;
                    return;

                case MessageBoxResult.Yes:
                    SampleRule.Save();
                    break;
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 绑定Grid
        /// </summary>

        public override void BindGrid()
        {
            SampleRule rule = new SampleRule();

            gridView1.GridControl.DataSource = rule.RShow2(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("SelectFlag", "0 SelectFlag"));
            gridView1.GridControl.Show();
        }
Exemplo n.º 4
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            SampleRule rule = new SampleRule();

            gridView1.GridControl.DataSource = rule.RShow(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1));
            gridView1.GridControl.Show();
            ProcessGrid.SetGridEdit(gridView1, new string[] { "EventStatus" }, true);
        }
Exemplo n.º 5
0
        public void TestValidate()
        {
            var rule   = new SampleRule("サンプルルール");
            var target = new ValidationTarget("Assets/VitDeck/Validator/Tests/SampleRule");
            var result = rule.Validate(target);

            Assert.That(result.RuleName, Is.EqualTo("サンプルルール"));
            Assert.That(result.Issues.Count, Is.AtLeast(1));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            SampleRule rule   = new SampleRule();
            Sample     entity = EntityGet();

            SampleDts[] entitydts = EntityDtsGet();
            entity.SubmitFlag = this.HTSubmitFlagUpdateGet();
            rule.RUpdate(entity, entitydts);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            SampleRule rule   = new SampleRule();
            Sample     entity = EntityGet();

            SampleDts[] entitydts = EntityDtsGet();

            entity.SubmitFlag = this.HTSubmitFlagInsertGet();
            rule.RAdd(entity, entitydts);
            return(entity.ID);
        }
Exemplo n.º 8
0
        public void TestInitial(Browser browser, string text)
        {
            var rule = new SampleRule(configuration, browser);

            rule.OpenPage();
            rule.SetSearchText(text);
            rule.SubmitSearch();
            rule.ValidSearch();
            rule.ClosePage();

            //rule.SampleRuleTeste();

            Assert.True(true); // insira aqui sua validação do test
        }
Exemplo n.º 9
0
        public void GetManifestRuleShouldReturnAManifestRuleWithCorrectConfigurationAction([Frozen] IGetsManifestRuleIdentifier identifierFactory,
                                                                                           [Frozen, ManifestModel] ValidatorBuilderContext context,
                                                                                           RuleBuilder <SampleRule> sut,
                                                                                           [ManifestModel] ManifestRuleIdentifier identifier,
                                                                                           string stringPropValue)
        {
            Mock.Get(identifierFactory)
            .Setup(x => x.GetManifestRuleIdentifier(typeof(SampleRule), It.IsAny <ValidatorBuilderContext>(), It.IsAny <string>()))
            .Returns(identifier);
            sut.ConfigureRule(r => r.StringProp = stringPropValue);
            sut.Dependencies.Clear();

            var rule = sut.GetManifestValue().Rules.Single();

            var sampleRule = new SampleRule();

            rule.RuleConfiguration(sampleRule);
            Assert.That(sampleRule.StringProp, Is.EqualTo(stringPropValue), "Configuration action applied correctly");
        }