Exemplo n.º 1
0
 public AuthenticationService(IConfiguration config, WebApplicationDbContext dbContext, IMapper mapper, IPasswordHasher <User> passwordHasher)
 {
     this.config         = config;
     this.dbContext      = dbContext;
     this.mapper         = mapper;
     this.passwordHasher = passwordHasher;
 }
Exemplo n.º 2
0
        public TestContext()
        {
            var options = new DbContextOptionsBuilder <WebApplicationDbContext>().UseInMemoryDatabase(databaseName: "TestDb").Options;

            DbContext = new WebApplicationDbContext(options);
            DbContext.Users.RemoveRange(DbContext.Users);
            DbContext.HighScores.RemoveRange(DbContext.HighScores);
            DbContext.SaveChanges();

            Config = A.Fake <IConfiguration>();
        }
Exemplo n.º 3
0
 public BaseTest(TestContext testContext)
 {
     DbContext = testContext.DbContext;
     Config    = testContext.Config;
     if (!isInitialized)
     {
         Mapper.Initialize(config => config.AddProfile(new MapperProfile()));
         isInitialized = true;
     }
     MapperInstance = Mapper.Instance;
 }
 public UserController(WebApplicationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public UserAccountRepository(WebApplicationDbContext context) : base(context)
 {
 }
Exemplo n.º 6
0
 public SampleDataController(WebApplicationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 7
0
 public SQLRestaurantDataService(WebApplicationDbContext webApplicationDbContext)
 {
     this.dbContext = webApplicationDbContext;
 }
 public HighScoreService(WebApplicationDbContext dbContext, IMapper mapper)
 {
     this.dbContext = dbContext;
     this.mapper    = mapper;
 }