Beispiel #1
0
        public void Validate_EventReference_TriggerEventConsumed_ShouldFail()
        {
            //arrange
            var workflow = WorkflowDefinition.Create("fake", "fake", "fake")
                           .AddEvent(new EventDefinition()
            {
                Kind = EventKind.Consumed, Name = "fake"
            })
                           .StartsWith("fake", flow => flow.Callback())
                           .End()
                           .Build();
            var eventRef = new EventReference()
            {
                TriggerEvent = "fake"
            };

            //act
            var result = new EventReferenceValidator(workflow).Validate(eventRef);

            //assert
            result.Should()
            .NotBeNull();
            result.Errors.Should()
            .NotBeNullOrEmpty()
            .And.Contain(e => e.PropertyName == nameof(EventReference.TriggerEvent));
        }
Beispiel #2
0
        public void Validate_EventReference_ResultEventNotSet_ShouldFail()
        {
            //arrange
            var workflow = WorkflowDefinition.Create("fake", "fake", "fake")
                           .StartsWith("fake", flow => flow.Callback())
                           .End()
                           .Build();
            var eventRef = new EventReference()
            {
                ProduceEvent = "fake"
            };

            //act
            var result = new EventReferenceValidator(workflow).Validate(eventRef);

            //assert
            result.Should()
            .NotBeNull();
            result.Errors.Should()
            .NotBeNullOrEmpty()
            .And.Contain(e => e.PropertyName == nameof(EventReference.ResultEvent));
        }