Ejemplo n.º 1
0
        public void TestAddDeleteRangeBoard()
        {
            const string desc         = "Board PI TestAddDeleteRangeBoard";
            var          startNBoards = _br.Count();
            var          boardlist    = new List <Board>()
            {
                new Board {
                    Name = "Board PI TestAddDeleteRange1", Discription = desc
                },
                new Board {
                    Name = "Board PI TestAddDeleteRange2", Discription = desc
                },
                new Board {
                    Name = "Board PI TestAddDeleteRange3", Discription = desc
                }
            };

            _br.AddRange(boardlist);
            Assert.AreEqual(startNBoards + 3, _br.Count());
            var addedboards = _br.FindAllBy(b => b.Discription == desc);

            Assert.AreEqual(3, addedboards.Count());
            _br.DeleteRange(addedboards);
            Assert.AreEqual(0, _br.FindAllBy(b => b.Discription == desc).Count());
            Assert.AreEqual(startNBoards, _br.Count());
        }