public void Init() { context = TestDbContextFactory.Build(); organization = context.Organizations.First(); expenseType = context.TransactionSubTypes.OfType <ExpenseType>().First(); var accountType = context.AccountTypes.First(); var fundType = context.FundTypes.First(); account = new SubsidiaryAccount { Id = -1, Name = "Test Account", UpdatedBy = "Foo", CreatedBy = "Foo", AccountType = accountType, Organization = organization }; fund = new SubsidiaryFund { Id = -1, Name = fundType.Name, BankNumber = "42", Code = "123", CreatedBy = "Foo", UpdatedBy = "Foo", FundType = fundType, Organization = organization }; fund.Subsidiaries.Add(account); account.Fund = fund; context.Funds.Add(fund); payee = new Payee { Name = "Test", AddressLine1 = "123 Street", City = "Foo", State = "FO", PostalCode = "98503", Organization = organization, UpdatedBy = "Foo", CreatedBy = "Foo" }; context.Payees.Add(payee); context.SaveChanges(); }
public void Init() { principalProvider = Substitute.For <IPrincipalProvider>(); principal = Substitute.For <IPrincipal>(); principalProvider.GetCurrent().Returns(principal); principal.Identity.Name.Returns("user"); interceptor = new AuditChangeInterceptor(principalProvider) { Logger = Substitute.For <ILogger>() }; context = TestDbContextFactory.Build(interceptors: new[] { interceptor }); }
public void Init() { context = TestDbContextFactory.Build(); organization = context.Organizations.First(); receiptType = context.TransactionSubTypes.OfType <ReceiptType>().First(); var accountType = context.AccountTypes.First(); var fundType = context.FundTypes.First(); account = new SubsidiaryAccount { Id = -1, Name = "Test Account", UpdatedBy = "Foo", CreatedBy = "Foo", AccountType = accountType, Organization = organization }; fund = new SubsidiaryFund { Id = -1, Name = fundType.Name, BankNumber = "42", Code = "123", CreatedBy = "Foo", UpdatedBy = "Foo", FundType = fundType, Organization = organization }; fund.Subsidiaries.Add(account); account.Fund = fund; context.Funds.Add(fund); context.SaveChanges(); }
public void Init() { context = TestDbContextFactory.Build(); }
public void Init() { context = TestDbContextFactory.Build(); organization = context.Organizations.First(); }