示例#1
0
 /// <summary>
 /// Configures the specified fixture's act step to be aN HTTP request with the specified method, url and body.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="method">The method.</param>
 /// <param name="url">The URL.</param>
 /// <param name="model">The model.</param>
 /// <returns></returns>
 public static IMvcFunctionalTestFixture WhenCallingRestMethod <TModel>(this IMvcFunctionalTestFixture fixture, HttpMethod method,
                                                                        string url,
                                                                        out TModel model)
 {
     model = fixture.Create <TModel>();
     return(fixture.WhenCallingRestMethod(method, url, model));
 }
 /// <summary>
 /// Creates an auto fixture constructed instance of the specified model.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="model">The model.</param>
 /// <param name="configurator">The configurator.</param>
 /// <returns></returns>
 public static IMvcFunctionalTestFixture HavingModel <TModel>(this IMvcFunctionalTestFixture fixture,
                                                              out TModel model,
                                                              Action <TModel> configurator = null)
 {
     model = fixture.Create <TModel>();
     configurator?.Invoke(model);
     return(fixture);
 }
 public static IMvcFunctionalTestFixture HavingDatabaseWithSingleBreakfastItem(this IMvcFunctionalTestFixture fixture, out BreakfastItem item)
 {
     item = fixture.Create <BreakfastItem>();
     return(fixture.HavingDatabaseWithBreakfastItems(item));
 }