Beispiel #1
0
        public void CreateComponentInfo()
        {
            var componentDescriptor = new PipelineComponentDescriptor <FailedMessageRoutingEnablerComponent>(new FailedMessageRoutingEnablerComponent());

            var visitor       = new VisitorSpy();
            var componentInfo = visitor.CreateComponentInfo(componentDescriptor);

            var expectedProperties = new[] {
                new PropertyContents("Enabled", true),
                new PropertyContents("EnableFailedMessageRouting", true),
                new PropertyContents("SuppressRoutingFailureReport", true)
            };

            componentInfo.QualifiedNameOrClassId.Should().Be(typeof(FailedMessageRoutingEnablerComponent).AssemblyQualifiedName);
            componentInfo.ComponentName.Should().Be(nameof(FailedMessageRoutingEnablerComponent));

            componentInfo.ComponentProperties
            .Cast <PropertyContents>()
            .Should().BeEquivalentTo(expectedProperties);
        }
        public void CreateComponentInfo()
        {
            var componentDescriptor = new PipelineComponentDescriptor <ActivityTrackerComponent>(new ActivityTrackerComponent());

            var visitor       = new Visitor();
            var componentInfo = visitor.CreateComponentInfo(componentDescriptor);

            var expectedProperties = new[] {
                new PropertyContents("Enabled", true),
                new PropertyContents("TrackingContextRetentionDuration", 60),
                new PropertyContents("TrackingModes", "Body"),
            };

            Assert.That(componentInfo.QualifiedNameOrClassId, Is.EqualTo(typeof(ActivityTrackerComponent).FullName));
            Assert.That(componentInfo.ComponentName, Is.EqualTo(typeof(ActivityTrackerComponent).Name));
            Assert.That(
                componentInfo.ComponentProperties
                .Cast <PropertyContents>()
                .SequenceEqual(expectedProperties, new LambdaComparer <PropertyContents>((left, right) => left.Name.Equals(right.Name) && left.Value.Equals(right.Value))));
        }