コード例 #1
0
        public PortfolioSeedDataFixture()
        {
            // The Database should have a different name each time..
            Action <DbContextOptionsBuilder> configureDbContext = db => db.UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString());

            PortfolioAceDbContextFactory factory = new PortfolioAceDbContextFactory(configureDbContext);

            PortfolioContext = factory.CreateDbContext();
            TestSeeds.SeedPortfolio(PortfolioContext);
        }
コード例 #2
0
        public void DummyServiceTest3()
        {
            Action <DbContextOptionsBuilder> configureDbContext = db => db.UseInMemoryDatabase(databaseName: "DummyServiceTest3");
            PortfolioAceDbContextFactory     factory            = new PortfolioAceDbContextFactory(configureDbContext);

            using (PortfolioAceDbContext context = factory.CreateDbContext())
            {
                TestSeeds.SeedPortfolio(context);
            }
            IAdminService aService = new AdminService(factory);
            bool          res      = aService.SecurityExists("MSFT", "Cryptocurrency");

            Assert.False(res);
        }
コード例 #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            _host.Start();
            System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false; // allows me to put negatives in textbox

            PortfolioAceDbContextFactory contextFactory = _host.Services.GetRequiredService <PortfolioAceDbContextFactory>();

            using (PortfolioAceDbContext context = contextFactory.CreateDbContext())
            {
                context.Database.Migrate();
            }

            Window window = _host.Services.GetRequiredService <MainWindow>();

            window.Show();
            base.OnStartup(e);
        }
コード例 #4
0
 public TransferAgencyService(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #5
0
 public AdminService(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #6
0
 public StaticReferences(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #7
0
 public SettingService(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #8
0
 public TransactionService(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #9
0
 public FactTableService(PortfolioAceDbContextFactory contextFactory)
 {
     this._contextFactory = contextFactory;
 }
コード例 #10
0
 public PriceService(PortfolioAceDbContextFactory contextFactory, DataConnectionFactory dataFactory)
 {
     this._contextFactory = contextFactory;
     this._dataFactory    = dataFactory;
 }