public void EliminatePurchaseFromAnotherCountryEmpty() { Repository.GetPurchases().Clear(); Repository.AddAccount(Account); Repository.AddEnrollment(Enrollment); Purchase Purchase = new Purchase(Enrollment, 30, DateTime.Now, Account); Repository.AddPurchase(Purchase); List <Purchase> Purchases = Repository.EliminatePurchasesFromAnoterCountry(Repository.GetPurchases(), Repository.GetACountry("Argentina")); Assert.AreEqual(0, Purchases.ToArray().Length); using (var MyContext = new MyContext()) { MyContext.Enrollments.Attach(Enrollment); MyContext.Accounts.Attach(Account); MyContext.Purchases.Attach(Purchase); } }
private void ArePurchasesOnThatDate(DateTime InitialDateOfPurchase, DateTime FinalDateOfPurchase) { List <Purchase> PurchasesOnThatDate = Repository.InsertPurchaseOnThatDate(InitialDateOfPurchase, FinalDateOfPurchase); if (!cboCountry.Text.Equals("")) { PurchasesOnThatDate = Repository.EliminatePurchasesFromAnoterCountry(PurchasesOnThatDate, Repository.GetACountry(cboCountry.Text)); } dgvReports.DataSource = PurchasesOnThatDate; }