Example #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;
        }
Example #2
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;
        }
Example #3
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;
        }
Example #4
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;
        }
Example #5
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;
        }
Example #6
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;
		}
Example #7
0
 protected Mock(IBehaviorSettings defaultBehaviors, IBehaviorSelectorFactory selectorFactory)
     : base(defaultBehaviors, selectorFactory)
 {
 }
Example #8
0
 protected Mock(IBehaviorSettings defaultBehaviors)
     : base(defaultBehaviors)
 {
 }