Esempio n. 1
0
        public void ListRepository_FindItemsByQuery()
        {
            ResetList();

            var item1 = GetTestEntity();
            var item2 = GetTestEntity();
            var item3 = GetTestEntity();
            var item4 = GetTestEntity();
            var item5 = GetTestEntity();

            _listRepository.Create(item1);
            _listRepository.Create(item2);
            _listRepository.Create(item3);
            _listRepository.Create(item4);
            _listRepository.Create(item5);

            var spquery = new SPQuery
            {
                Query = "<Where><Eq><FieldRef Name=\"Title\" /><Value Type=\"Text\">" + item1.Title + "</Value></Eq></Where>"
            };

            var items = _listRepository.FindByQuery(spquery);
            var count = items.Count;

            Assert.IsTrue(count == 5);

            ResetList();
        }