示例#1
0
 /// <summary>
 /// Specifies that the
 /// <see cref="TestView(Action{ViewResult})"/> or
 /// <see cref="TestJson(Action{JsonResult})"/> method should throw an exception
 /// if the action result's .Model or .Data type doesn't match <typeparamref name="TModelType"/>.
 /// </summary>
 /// <typeparam name="TModelType">The expected model type.</typeparam>
 /// <param name="validate">(Optional) callback action to preform additional model validation.</param>
 /// <returns>"This" <see cref="ControllerActionTester"/>.</returns>
 public ControllerActionTester ExpectingModel <TModelType>(Action <TModelType> validate = null)
 {
     _modelTester = new ModelTester <TModelType>(validate);
     return(this);
 }
示例#2
0
 /// <summary>
 /// Specifies that the
 /// <see cref="TestPage(Action{PageResult})"/> or
 /// <see cref="TestJsonResult(Action{JsonResult})"/> method should throw an exception
 /// if the action result's .Model or .Value type doesn't match <typeparamref name="TModelType"/>.
 /// </summary>
 /// <remarks>
 /// The <see cref="ExpectingModel(Action{TPageModel})"/> method is easier to use
 /// with <see cref="TestPage(Action{PageResult})"/>.
 /// </remarks>
 /// <typeparam name="TModelType">The expected model type.</typeparam>
 /// <param name="validate">(Optional) callback action to preform additional model validation.</param>
 /// <returns>"This" <see cref="PageModelActionTester"/>.</returns>
 public PageModelActionTester <TPageModel> ExpectingModel <TModelType>(Action <TModelType> validate = null)
 {
     _modelTester = new ModelTester <TModelType>(validate);
     return(this);
 }
 /// <summary>
 /// Specifies that the
 /// <see cref="TestView(Action{ViewResult})"/> or
 /// <see cref="TestJson(Action{JsonResult})"/> method should throw an exception
 /// if the action result's .Model or .Value type doesn't match <typeparamref name="TModelType"/>.
 /// </summary>
 /// <typeparam name="TModelType">The expected model type.</typeparam>
 /// <param name="validate">(Optional) callback action to preform additional model validation.</param>
 /// <returns>"This" <see cref="ViewComponentInvocationTester"/>.</returns>
 public ViewComponentInvocationTester ExpectingModel <TModelType>(Action <TModelType> validate = null)
 {
     _modelTester = new ModelTester <TModelType>(validate);
     return(this);
 }
示例#4
0
 public GenericCrudControllerTests(WebApplicationFactory <Startup> factory, IModelRenderer <TModel, TView> renderer, IModelTester <TModel> model, string version)
 {
     this.Factory  = factory;
     this.Renderer = renderer;
     this.Model    = model;
     this.Version  = version;
 }