Beispiel #1
0
        public void Should_not_trigger_precheck_if_rule_id_not_matchs()
        {
            var ctx = Context();

            var @event = new AppUsageExceeded();

            var result = sut.Trigger(Envelope.Create <AppEvent>(@event), ctx);

            Assert.True(result);
        }
Beispiel #2
0
        public void Should_trigger_precheck_if_event_type_correct()
        {
            TestForCondition(string.Empty, ctx =>
            {
                var @event = new SchemaCreated();

                var result = sut.Trigger(Envelope.Create <AppEvent>(@event), ctx);

                Assert.True(result);
            });
        }
Beispiel #3
0
        public void Should_trigger_check_if_condition_is_empty()
        {
            TestForCondition(string.Empty, ctx =>
            {
                var @event = new EnrichedAssetEvent();

                var result = sut.Trigger(@event, ctx);

                Assert.True(result);
            });
        }
        public void Should_not_trigger_precheck_if_trigger_contains_no_schemas()
        {
            TestForTrigger(handleAll: false, schemaId: null, condition: null, action: ctx =>
            {
                var @event = new ContentCreated {
                    SchemaId = schemaMatch
                };

                var result = sut.Trigger(Envelope.Create <AppEvent>(@event), ctx);

                Assert.False(result);
            });
        }
        public void Should_not_trigger_precheck_when_event_type_not_correct()
        {
            TestForCondition(string.Empty, trigger =>
            {
                var result = sut.Trigger(new ContentCreated(), trigger, DomainId.NewGuid());

                Assert.False(result);
            });
        }
Beispiel #6
0
        public void Should_not_trigger_precheck_when_event_type_not_correct()
        {
            TestForTrigger(handleAll: true, schemaId: null, condition: null, action: trigger =>
            {
                var result = sut.Trigger(new AssetCreated(), trigger, ruleId);

                Assert.False(result);
            });
        }
Beispiel #7
0
 public void Should_always_trigger()
 {
     Assert.True(sut.Trigger(new EnrichedManualEvent(), new ManualTrigger()));
 }
        public void Should_not_trigger_precheck_when_event_type_not_correct()
        {
            var result = sut.Trigger(new ContentCreated(), new UsageTrigger(), ruleId);

            Assert.False(result);
        }
        public async Task Should_not_create_job_if_rule_disabled()
        {
            var @event = Envelope.Create(new ContentCreated());

            var job = await sut.CreateJobAsync(ValidRule().Disable(), ruleId, @event);

            Assert.Null(job);

            A.CallTo(() => ruleTriggerHandler.Trigger(A <AppEvent> .Ignored, A <RuleTrigger> .Ignored, ruleId))
            .MustNotHaveHappened();
        }