public void CanCountWithPredicate() { var repository = new StockRepository(); var count = repository.Count(x => 1 == 0); Assert.AreEqual(0, count); }
public void CanCount() { var repository = new StockRepository(); var count = repository.Count(); Assert.AreEqual(0, count); }
public void CanInsert() { var repository = new StockRepository(); var stock = new Stock(); repository.Insert(stock); Assert.AreEqual(1, repository.Count()); }
public void CanNotInsertTheSameItemTwice() { var repository = new StockRepository(); var stock = new Stock(); repository.Insert(stock); repository.Insert(stock); Assert.AreEqual(1, repository.Count()); }
public void CanInsertList() { var repository = new StockRepository(); var stockList = new List <Stock> { new Stock(), new Stock() }; repository.InsertList(stockList); Assert.AreEqual(2, repository.Count()); }
public int Count(Func <Stock, bool> predicate = null) { return(repository.Count(predicate)); }