Exemple #1
0
        public void CanCountWithPredicate()
        {
            var repository = new StockRepository();
            var count      = repository.Count(x => 1 == 0);

            Assert.AreEqual(0, count);
        }
Exemple #2
0
        public void CanCount()
        {
            var repository = new StockRepository();
            var count      = repository.Count();

            Assert.AreEqual(0, count);
        }
Exemple #3
0
        public void CanInsert()
        {
            var repository = new StockRepository();
            var stock      = new Stock();

            repository.Insert(stock);

            Assert.AreEqual(1, repository.Count());
        }
Exemple #4
0
        public void CanNotInsertTheSameItemTwice()
        {
            var repository = new StockRepository();
            var stock      = new Stock();

            repository.Insert(stock);
            repository.Insert(stock);

            Assert.AreEqual(1, repository.Count());
        }
Exemple #5
0
        public void CanInsertList()
        {
            var repository = new StockRepository();
            var stockList  = new List <Stock> {
                new Stock(), new Stock()
            };

            repository.InsertList(stockList);

            Assert.AreEqual(2, repository.Count());
        }
Exemple #6
0
 public int Count(Func <Stock, bool> predicate = null)
 {
     return(repository.Count(predicate));
 }