Beispiel #1
0
        /// <summary>
        /// Tests whether a deeply equal object to the provided one is returned from the invoked HTTP response message content.
        /// </summary>
        /// <typeparam name="TResponseModel">Type of the response model.</typeparam>
        /// <param name="expectedModel">Expected model to be returned.</param>
        /// <returns>Builder for testing the response model errors.</returns>
        public IHttpHandlerModelDetailsTestBuilder <TResponseModel> WithResponseModel <TResponseModel>(TResponseModel expectedModel)
        {
            var actualModel = HttpResponseMessageValidator.WithResponseModel(
                this.httpResponseMessage.Content,
                expectedModel,
                this.ThrowNewHttpResponseMessageAssertionException,
                this.ThrowNewResponseModelAssertionException);

            return(new HttpHandlerModelDetailsTestBuilder <TResponseModel>(
                       this.Handler,
                       this,
                       actualModel));
        }
        /// <summary>
        /// Testuje, či sa hromadne zhodný objekt s poskytnutým objektom vráti z obsahu objektového hlásenia odozvy HTTP.
        /// </summary>
        /// <typeparam name="TResponseModel">Type of the response model.</typeparam>
        /// <param name="expectedModel">Expected model to be returned.</param>
        /// <returns>Builder for testing the response model errors.</returns>
        public IModelDetailsTestBuilder <TResponseModel> ValidWithResponseModel <TResponseModel>(TResponseModel expectedModel)
        {
            var actualModel = HttpResponseMessageValidator.WithResponseModel(
                this.ActionResult.Content,
                expectedModel,
                this.ThrowNewHttpResponseMessageAssertionException,
                this.ThrowNewResponseModelAssertionException);

            return(new ModelDetailsTestBuilder <TResponseModel>(
                       this.Controller,
                       this.ActionName,
                       this.CaughtException,
                       actualModel));
        }