public void AddOrderToRepository_CheckTotalCount() { using (var db = new DbRepository()) { NorthWind nw = new NorthWind(db); int totalOrdersBefore = nw.Orders.Count(); nw.AddOrder("Doegn Netto", "Rued Langgaards Vej 23a", "Copenhagen", "South", "2300", "Denmark"); db.SaveChanges(); int totalOrdersAfter = nw.Orders.Count(); Assert.AreEqual(totalOrdersBefore + 1, totalOrdersAfter); } }
public void AddOrderToRepository_CheckTotalCount() { var csvRepository = new CsvRepository(); csvRepository.LoadFiles(); NorthWind nw = new NorthWind(csvRepository); int totalOrdersBefore = nw.Orders.Count(); nw.AddOrder("Doegn Netto", "Rued Langgaards Vej 23a", "Copenhagen", "South", "2300", "Denmark"); int totalOrdersAfter = nw.Orders.Count(); Assert.AreEqual(totalOrdersBefore + 1, totalOrdersAfter); }