Esempio n. 1
0
        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 = "******"
                }
            });
        }
Esempio n. 2
0
 // 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);
     }
 }
Esempio n. 3
0
        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 = "******"
                }
            });
        }
Esempio n. 4
0
 public ShopBasket(MotoDBContext motoDBContext)
 {
     this.motoDB = motoDBContext;
     //this.ListShopItems = motoDB.MotoShopItems.ToList();
 }
Esempio n. 5
0
 public MotoRepos(MotoDBContext motoDBContext)
 {
     this.motoDB = motoDBContext;
 }
Esempio n. 6
0
 public MotorcyclesController(MotoDBContext context)
 {
     _context = context;
 }
Esempio n. 7
0
 public OrderRepository(MotoDBContext motoDBContext, ShopBasket shopBasket)
 {
     this.MotoDB = motoDBContext;
     this.Basket = shopBasket;
 }