public void Test_SetGetFilter_ShouldRetFilter()
        {
            //---------------Set up test pack-------------------
            var          bindingListRequest = MockRepository.GenerateStub <BindingListRequest <FakeBO> >();
            const string expectedFilter     = "FakeBOName = 1";
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            CachedBindingListView <FakeBO> list = new CachedBindingListView <FakeBO>(bindingListRequest)
            {
                Filter = expectedFilter
            };

            //---------------Test Result -----------------------
            Assert.AreEqual(expectedFilter, list.Filter);
        }
        public void Test_GetItemIndex5_When3Loaded_ShouldReturnItem()
        {
            //---------------Set up test pack-------------------
            CreateSavedBOs(6);
            var bindingListRequest = new BindingListRequest <FakeBO> {
                PageNumber = 0, RowsPerPage = 3
            };
            var list = new CachedBindingListView <FakeBO>(bindingListRequest);

            //---------------Assert Precondition----------------
            Assert.AreEqual(6, list.Count);
            //---------------Execute Test ----------------------
            var fakeBO = list[5];

            //---------------Test Result -----------------------
            Assert.IsNotNull(fakeBO);
        }
        public void Test_RemoveFilter_ShouldSetFilterToEmpty()
        {
            //---------------Set up test pack-------------------
            var          bindingListRequest     = MockRepository.GenerateStub <BindingListRequest <FakeBO> >();
            const string initialFilter          = "FakeBOName = 1";
            CachedBindingListView <FakeBO> list = new CachedBindingListView <FakeBO>(bindingListRequest)
            {
                Filter = initialFilter
            };

            //---------------Assert Precondition----------------
            Assert.AreEqual(initialFilter, list.Filter);
            //---------------Execute Test ----------------------
            list.RemoveFilter();
            //---------------Test Result -----------------------
            Assert.IsEmpty(list.Filter);
        }
        public void Test_Construct_WithEmptyConstructor_ShouldNotRaiseError()
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            CachedBindingListView <FakeBO> list = new CachedBindingListView <FakeBO>();

            //---------------Test Result -----------------------
            Assert.IsNotNull(list);
            Assert.IsFalse(list.AllowEdit);
            Assert.IsFalse(list.AllowNew);
            Assert.IsFalse(list.AllowRemove);
            Assert.IsTrue(list.IsFixedSize);
            Assert.IsTrue(list.IsReadOnly);
            Assert.IsTrue(list.SupportsAdvancedSorting);
            Assert.IsTrue(list.SupportsChangeNotification);
            Assert.IsTrue(list.SupportsFiltering);
            Assert.IsFalse(list.SupportsSearching);
            Assert.IsTrue(list.SupportsSorting);
        }