示例#1
0
        public TestContext()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Testing")
                          .UseStartup <TestStartup>();

            _server    = new TestServer(builder);
            Client     = _server.CreateClient();
            _dbContect = _server.Host.Services.GetService(typeof(FundTrackContext)) as FundTrackContext;
            //_unitOfWork = _server.Host.Services.GetService(typeof(IUnitOfWork)) as IUnitOfWork;

            TestTargetRepository       = new TestTargetRepository(_dbContect);
            TestIncomeReportRepository = new TestIncomeReportRepository(_dbContect);
            TestFinOpRepository        = new TestFinOpRepository(_dbContect);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserRepository"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public UserRepository(FundTrackContext context)
 {
     this.context = context;
 }
 public TargetRepositoryTests()
 {
     this._fakeBuilder = new FakeFundTrackDbContextBaseBuilder();
     this._fakeBuilder.SetTargets();
     this._context = this._fakeBuilder.GetFakeContext();
 }
示例#4
0
 public TestFinOpRepository(FundTrackContext dbContext)
 {
     _dbContext = dbContext;
 }
 public TestIncomeReportRepository(FundTrackContext dbContext)
 {
     _dbContext = dbContext;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OrganizationRegistrationRepositoryTest"/> class.
 /// </summary>
 public OrganizationRegistrationRepositoryTest()
 {
     this._fakeBuilder = new FakeFundTrackDbContextBaseBuilder();
     this._fakeBuilder.SetOrganizations();
     this._context = this._fakeBuilder.GetFakeContext();
 }
示例#7
0
 public TestTargetRepository(FundTrackContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhoneRepositoryTest"/> class.
 /// </summary>
 public PhoneRepositoryTest()
 {
     this._fakeBuilder = new FakeFundTrackDbContextBaseBuilder();
     this._fakeBuilder.SetPhones();
     this._context = this._fakeBuilder.GetFakeContext();
 }
示例#9
0
 /// <summary>
 /// Creates the database context.
 /// </summary>
 /// <param name="options">The options.</param>
 public void CreateDbContext(DbContextOptions <FundTrackContext> options)
 {
     context = new FundTrackContext(options);
 }