public LoginActionTestTheoryData() { var options = new DbContextOptionsBuilder <MotoDBContext>() .UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MotoSocia;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False") .Options; var context = new MotoDBContext(options); Add(new LoginActionTestParameter { context = context, user = new Models.User.LoginUserModel() }); Add(new LoginActionTestParameter { context = context, user = new Models.User.LoginUserModel() { UserName = "", Password = "" } }); Add(new LoginActionTestParameter { context = context, user = new Models.User.LoginUserModel() { UserName = "******", Password = "******" } }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseDeveloperExceptionPage(); app.UseStatusCodePages(); app.UseStaticFiles(); app.UseSession(); app.UseMvcWithDefaultRoute(); app.UseMvc(rout => { rout.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}"); rout.MapRoute(name: "modelFilter", template: "Moto/{action}/{model?}", defaults: new { Controller = "Moto", action = "List" }); } ); using (var scope = app.ApplicationServices.CreateScope()) { MotoDBContext db = scope.ServiceProvider.GetRequiredService <MotoDBContext>(); DBObjects.Initial(db); } }
public GetUserDataTestTheoryData() { var options = new DbContextOptionsBuilder <MotoDBContext>() .UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MotoSocia;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False") .Options; var context = new MotoDBContext(options); Add(new GetUserDataTestParameter()); Add(new GetUserDataTestParameter() { Context = context }); Add(new GetUserDataTestParameter() { Context = context, User = new NewUserModel() }); Add(new GetUserDataTestParameter() { Context = context, User = new NewUserModel() { Email = "", UserName = "" } }); Add(new GetUserDataTestParameter() { Context = context, User = new NewUserModel() { Email = "test", UserName = "******" } }); }
public ShopBasket(MotoDBContext motoDBContext) { this.motoDB = motoDBContext; //this.ListShopItems = motoDB.MotoShopItems.ToList(); }
public MotoRepos(MotoDBContext motoDBContext) { this.motoDB = motoDBContext; }
public MotorcyclesController(MotoDBContext context) { _context = context; }
public OrderRepository(MotoDBContext motoDBContext, ShopBasket shopBasket) { this.MotoDB = motoDBContext; this.Basket = shopBasket; }