示例#1
0
        public void ListRepository_FindItemsByCAML_SingleExpression()
        {
            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 caml = new CAMLExpression
            {
                Column   = "Title",
                Operator = CAMLOperator.Eq,
                Type     = "Text",
                Value    = item1.Title
            };

            var items = _listRepository.FindByCAML(caml);
            var count = items.Count;

            Assert.IsTrue(count == 5);

            ResetList();
        }