public VaultInformationService(
     IAuthenticationService authenticationService,
     FsDbContext dbContext)
 {
     _authenticationService = authenticationService;
     _dbContext             = dbContext;
 }
Beispiel #2
0
        public static FsDbContext DbContextMock()
        {
            if (_fsDbContext != null)
            {
                return(_fsDbContext);
            }

            var options = new DbContextOptionsBuilder <FsDbContext>()
                          .UseInMemoryDatabase(databaseName: "FreeSecurDB")
                          .ConfigureWarnings(x => x.Ignore(InMemoryEventId.TransactionIgnoredWarning))
                          .Options;

            var dbContext = new FsDbContext(options);

            dbContext.Owners.Add(MockEntities.TestOwner());
            dbContext.Users.Add(MockEntities.TestUser());

            dbContext.Vaults.Add(MockEntities.TestVault());
            dbContext.VaultOwners.Add(MockEntities.TestVaultOwner());
            dbContext.VaultOwnerRights.AddRange(MockEntities.TestVaultOwnerRights());
            dbContext.VaultItems.Add(MockEntities.TestVaultItem());

            dbContext.SaveChanges();

            _fsDbContext = dbContext;

            return(dbContext);
        }
 public VaultCreationService(
     IAuthenticationService authenticationService,
     IFsEntityRepository entityRepository,
     FsDbContext dbContext,
     IHashService hashService)
 {
     _authenticationService = authenticationService;
     _entityRepository      = entityRepository;
     _dbContext             = dbContext;
     _hashService           = hashService;
 }
Beispiel #4
0
 public AccountManagementService(
     IFsEntityRepository entityRepository,
     IHashService hashService,
     IMailService mailService,
     FsDbContext dbContext,
     IAuthenticationService authenticationService,
     IVerificationService verificationService
     )
 {
     _entityRepository      = entityRepository;
     _hashService           = hashService;
     _mailService           = mailService;
     _dbContext             = dbContext;
     _authenticationService = authenticationService;
     _verificationService   = verificationService;
 }
Beispiel #5
0
 public static IFsEntityRepository EntityRepositoryMock(FsDbContext dbContext)
 {
     return(new FsEntityRepository(dbContext, DateTimeProviderMock().Object));
 }