Exemplo n.º 1
0
        public async Task RegisterAsync(Guid userId, string password)
        {
            var passwordHash = encrypter.GetHash(password);
            var token        = encrypter.GetToken(userId, passwordHash);
            var user         = new User(userId, passwordHash, token);

            dbContext.Add(user);
            await dbContext.SaveChangesAsync();
        }
        public NotificationControllerTest()
        {
            _dbOptions = new DbContextOptionsBuilder <NotificationsDbContext>()
                         .UseInMemoryDatabase(databaseName: "in-memory")
                         .Options;

            using (var dbContext = new NotificationsDbContext(_dbOptions))
            {
                dbContext.AddRange(GetNoticationSeed());
                dbContext.Add(GetTemplateData());
                dbContext.SaveChanges();
            }
        }