예제 #1
0
        public UserControllerTests()
        {
            _connection = new SqliteConnection("Data Source=:memory:");

            _connection.Open();

            var options = new DbContextOptionsBuilder <MobicloneContext>().UseSqlite(_connection).Options;

            _context = new MobicloneContext(options);

            var hash = new Bcrypt();

            var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.Test.json").Build();

            _accessor = new HttpContextAccessor
            {
                HttpContext = new DefaultHttpContext()
            };

            var auth = new Jwt(_context, hash, configuration, _accessor);

            _controller = new UserController(_context, auth, hash);

            _context.Database.EnsureCreated();
        }
예제 #2
0
파일: Jwt.cs 프로젝트: flaviogf/mobiclone
 public Jwt(MobicloneContext context, IHash hash, IConfiguration configuration, IHttpContextAccessor accessor)
 {
     _context       = context;
     _hash          = hash;
     _configuration = configuration;
     _accessor      = accessor;
 }
예제 #3
0
        public ExpenseControllerTests()
        {
            var builder = new DbContextOptionsBuilder <MobicloneContext>().UseInMemoryDatabase("expense");

            _context = new MobicloneContext(builder.Options);

            var hash = new Bcrypt();

            var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.Test.json").Build();

            _accessor = new HttpContextAccessor
            {
                HttpContext = new DefaultHttpContext()
            };

            var auth = new Jwt(_context, hash, configuration, _accessor);

            _controller = new ExpenseController(_context, auth);
        }
 public CurrentBalanceController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
예제 #5
0
 public RevenueController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
예제 #6
0
 public AccountController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
 public MonthlyBalanceController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
예제 #8
0
 public TransferController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
예제 #9
0
 public ExpenseController(MobicloneContext context, IAuth auth)
 {
     _context = context;
     _auth    = auth;
 }
예제 #10
0
 public UserController(MobicloneContext context, IAuth auth, IHash hash)
 {
     _context = context;
     _auth    = auth;
     _hash    = hash;
 }
예제 #11
0
 public AvatarController(MobicloneContext context, IAuth auth, IStorage storage)
 {
     _context = context;
     _auth    = auth;
     _storage = storage;
 }