public void Can_persist_ClientFund_with_a_ClientAccount() { var fundType = context.FundTypes.First(); var fund = new ClientFund { Id = -1, Name = fundType.Name, BankNumber = "42", Code = "123", CreatedBy = "Foo", UpdatedBy = "Foo", FundType = fundType, Organization = organization }; var clientAccountType = context.AccountTypes.First(); var clientAccount = new ClientAccount { Id = -1, Name = "ClientFund", BankNumber = "42", CreatedBy = "Foo", UpdatedBy = "Foo", AccountType = clientAccountType, Organization = organization }; var client = new Client { Id = -1, FirstName = "Millhouse", LastName = "Manastorm", UpdatedBy = "Foo", CreatedBy = "Foo" }; client.AddResidency(organization); clientAccount.Residency = client.Residencies.First(); clientAccount.Fund = fund; fund.ClientAccounts.Add(clientAccount); context.Funds.Add(fund); context.SaveChanges(); Assert.AreNotEqual(-1, fund.Id); Assert.AreNotEqual(-1, clientAccount.Id); }
public void Can_persist_ClientFund() { var fundType = context.FundTypes.First(); var fund = new ClientFund { Id = -1, Name = fundType.Name, BankNumber = "42", Code = "123", CreatedBy = "Foo", UpdatedBy = "Foo", FundType = fundType, Organization = organization }; context.Funds.Add(fund); context.SaveChanges(); Assert.AreNotEqual(-1, fund.Id); }