Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MockApiModel"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="routeTemplate">The route template.</param>
 /// <param name="body">The body.</param>
 /// <param name="verb">The verb.</param>
 /// <param name="language">The language.</param>
 public MockApiModel(string name,
                     string routeTemplate,
                     string body,
                     MockApiHttpVerb verb,
                     MockApiLanguage language)
 {
     this.Name          = name;
     this.RouteTemplate = routeTemplate;
     this.Body          = body;
     this.Verb          = verb;
     this.Language      = language;
 }
Example #2
0
        /// <summary>
        /// HTTPs the method match.
        /// </summary>
        /// <param name="httpMethod">The HTTP method.</param>
        /// <param name="apiVerb">The API verb.</param>
        /// <returns>true if match false othwewise</returns>
        private static bool HttpMethodMatch(HttpMethod httpMethod, MockApiHttpVerb apiVerb)
        {
            switch (apiVerb)
            {
            case MockApiHttpVerb.Get:
                return(httpMethod == HttpMethod.Get);

            case MockApiHttpVerb.Post:
                return(httpMethod == HttpMethod.Post);

            case MockApiHttpVerb.Put:
                return(httpMethod == HttpMethod.Put);

            case MockApiHttpVerb.Delete:
                return(httpMethod == HttpMethod.Delete);

            default:
                return(false);
            }
        }