コード例 #1
0
        public static IFlowData CreateFlowData(IPipelineInternal pipeline)
        {
            var logger         = new Mock <ILogger <FlowData> >();
            var evidenceLogger = new Mock <ILogger <Evidence> >();
            var evidence       = new Evidence(evidenceLogger.Object);

            return(new FlowData(logger.Object, pipeline, evidence));
        }
コード例 #2
0
        /// <summary>
        /// Factory method that will be used by the created
        /// <see cref="IPipeline"/> to create new <see cref="FlowData"/>
        /// instances.
        /// </summary>
        /// <param name="pipeline">
        /// The pipeline that is being used to create the flow data instance.
        /// </param>
        /// <returns>
        /// A new <see cref="FlowData"/> that is linked to the given pipeline.
        /// </returns>
        private IFlowData NewFlowData(IPipelineInternal pipeline)
        {
            var evidence = new Evidence(LoggerFactory.CreateLogger <Evidence>());

            return(new FlowData(
                       LoggerFactory.CreateLogger <FlowData>(),
                       pipeline,
                       evidence));
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="logger">
        /// The logger to use when events occur. Can be null.
        /// </param>
        /// <param name="pipeline">
        /// The pipeline that created this FlowData instance.
        /// </param>
        /// <param name="evidence">
        /// The initial evidence.
        /// </param>
        internal FlowData(
            ILogger <FlowData> logger,
            IPipelineInternal pipeline,
            Evidence evidence)
        {
            _logger          = logger;
            PipelineInternal = pipeline;
            _data            = new TypedKeyMap(pipeline?.IsConcurrent ?? false);
            _evidence        = evidence;

            if (_logger != null && _logger.IsEnabled(LogLevel.Debug))
            {
                _logger.LogDebug($"FlowData '{GetHashCode()}' created.");
            }
        }