Пример #1
0
        public void GetAllProducts_EmptyProductList_ReturnsEmptyList()
        {
            TransactionLibrary library      = new TransactionLibrary();
            List <Transaction> transactions = new List <Transaction>();

            IEnumerable <Transaction> result = library.GetAllTransactions(new EnumerableQuery <Transaction>(transactions));

            Assert.IsTrue(!result.Any());
        }
Пример #2
0
        public void GetAllProducts_PopulatedList_ReturnsPopulatedList()
        {
            TransactionLibrary library      = new TransactionLibrary();
            List <Transaction> transactions = new List <Transaction>();

            transactions.Add(new Transaction()
            {
                Id = 1
            });
            transactions.Add(new Transaction()
            {
                Id = 2
            });

            IEnumerable <Transaction> result = library.GetAllTransactions(new EnumerableQuery <Transaction>(transactions));

            Assert.IsTrue(result.Count() == 2);
            Assert.IsTrue(result.Any(p => p.Id == 1));
            Assert.IsTrue(result.Any(p => p.Id == 2));
        }