예제 #1
0
        public void Ctor__initializes_properly()
        {
            HttpActionInitializationContext context = new HttpActionInitializationContext();

            Assert.NotNull(context.ActionOptions);
            Assert.NotNull(context.Instrumentation);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HttpAction"/> class.
        /// </summary>
        /// <param name="initializationContext">The initialization context.</param>
        /// <exception cref="System.ArgumentNullException">initializationContext</exception>
        public HttpAction(HttpActionInitializationContext initializationContext)
        {
            if (initializationContext == null)
            {
                throw new ArgumentNullException("initializationContext");
            }

            if (initializationContext.ActionOptions == null)
            {
                throw new ArgumentException("Cannot initialize the action using the supplied context. The action options object is not set.");
            }

            if (initializationContext.Instrumentation == null)
            {
                throw new ArgumentException("Cannot initialize the action using the supplied context. The instrumentation context object is not set.");
            }


            this.ActionOptions   = initializationContext.ActionOptions;
            this.Instrumentation = initializationContext.Instrumentation;
        }
예제 #3
0
 public GetFakeDataHttpAction(HttpActionInitializationContext init)
     : base(init)
 {
 }