Example #1
0
        public async Task ValidateAsync_RuleWithNonValidationRuleAttribute_GetsRunAsync()
        {
            var rule = new ConsensusRuleWithoutNonValidationRuleAttribute();
            TestConsensusRules consensusRules = InitializeConsensusRules();

            this.network.Consensus.Rules = new List <IConsensusRule> {
                rule
            };
            consensusRules.Register();

            await consensusRules.ValidateAsync(new RuleContext()
            {
                SkipValidation = true
            });

            Assert.False(rule.RunCalled);
        }
        public async Task ValidateAsync_RuleWithNonValidationRuleAttribute_GetsRunAsync()
        {
            var rule = new ConsensusRuleWithoutNonValidationRuleAttribute();

            this.ruleRegistrations = new List <ConsensusRule> {
                rule
            };
            var consensusRules = InitializeConsensusRules();

            consensusRules.Register(this.ruleRegistration.Object);

            await consensusRules.ValidateAsync(new RuleContext()
            {
                SkipValidation = true
            });

            Assert.False(rule.RunCalled);
        }