Пример #1
0
        /// <summary>
        /// Prida poziadavku HTTP bez autorizaciou
        /// </summary>
        /// <param name="httpRequestMessageBuilder">Builder for HTTP request message.</param>
        /// <returns>Server test builder to test the returned HTTP response.</returns>
        public IServerTestBuilder WithHttpRequestMessageUnauthorized(Action <IHttpRequestMessageBuilder> httpRequestMessageBuilder)
        {
            var httpBuilder = new HttpRequestMessageBuilder();

            httpRequestMessageBuilder(httpBuilder);
            return(this.WithHttpRequestMessageUnauthorized(httpBuilder.GetHttpRequestMessage()));
        }
Пример #2
0
        /// <summary>
        /// Adds HTTP request message to the tested controller.
        /// </summary>
        /// <param name="httpRequestMessageBuilder">Builder for HTTP request message.</param>
        /// <returns>The same controller builder.</returns>
        public IAndControllerBuilder <TController> WithHttpRequestMessage(Action <IHttpRequestMessageBuilder> httpRequestMessageBuilder)
        {
            var httpBuilder = new HttpRequestMessageBuilder();

            httpRequestMessageBuilder(httpBuilder);
            return(this.WithHttpRequestMessage(httpBuilder.GetHttpRequestMessage()));
        }
 /// <summary>
 /// Sets the route HTTP request message to test using a builder.
 /// </summary>
 /// <param name="httpRequestMessageBuilder">Builder for HTTP request message.</param>
 /// <returns>Route test builder.</returns>
 public IShouldMapTestBuilder ShouldMap(Action<IHttpRequestMessageBuilder> httpRequestMessageBuilder)
 {
     var httpBuilder = new HttpRequestMessageBuilder();
     httpRequestMessageBuilder(httpBuilder);
     var requestMessage = httpBuilder.GetHttpRequestMessage();
     return this.ShouldMap(requestMessage);
 }
Пример #4
0
        /// <summary>
        /// Sets the route HTTP request message to test using a builder.
        /// </summary>
        /// <param name="httpRequestMessageBuilder">Builder for HTTP request message.</param>
        /// <returns>Route test builder.</returns>
        public IShouldMapTestBuilder ShouldMap(Action <IHttpRequestMessageBuilder> httpRequestMessageBuilder)
        {
            var httpBuilder = new HttpRequestMessageBuilder();

            httpRequestMessageBuilder(httpBuilder);
            var requestMessage = httpBuilder.GetHttpRequestMessage();

            return(this.ShouldMap(requestMessage));
        }
Пример #5
0
 /// <summary>
 /// Adds HTTP request message to the tested server.
 /// </summary>
 /// <param name="httpRequestMessageBuilder">Builder for HTTP request message.</param>
 /// <returns>Server test builder to test the returned HTTP response.</returns>
 public IServerTestBuilder WithHttpRequestMessage(Action<IHttpRequestMessageBuilder> httpRequestMessageBuilder)
 {
     var httpBuilder = new HttpRequestMessageBuilder();
     httpRequestMessageBuilder(httpBuilder);
     return this.WithHttpRequestMessage(httpBuilder.GetHttpRequestMessage());
 }