Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMock"/> class.
        /// </summary>
        /// <param name="defaultBehaviors">The default mock behaviors.</param>
        protected BaseMock(IBehaviorSettings defaultBehaviors)
            : this(defaultBehaviors, new DefaultSelectorFactory())
        {
            Guard.NotNull(() => defaultBehaviors, defaultBehaviors);

            this.defaultBehaviors = defaultBehaviors;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMock" /> class.
        /// </summary>
        /// <param name="defaultBehaviors">The default mock behaviors.</param>
        /// <param name="selectorFactory">The behavior selector factory.</param>
        protected BaseMock(IBehaviorSettings defaultBehaviors, IBehaviorSelectorFactory selectorFactory)
        {
            Guard.NotNull(() => defaultBehaviors, defaultBehaviors);
            Guard.NotNull(() => selectorFactory, selectorFactory);

            this.defaultBehaviors = defaultBehaviors;
            this.selectorFactory = selectorFactory;
        }
Exemple #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="Behavior"/> class.
		/// </summary>
		public Behavior(IBehaviorSettings settings, IBehaviorSelector selector)
		{
            Guard.NotNull(() => settings, settings);
            Guard.NotNull(() => selector, selector);

            this.before = new List<IAspect>(settings.Before);
            this.invoke = new List<IAspect>(settings.Invoke);
            this.after = new List<IAspect>(settings.After);

            this.selector = selector;
		}