public void Test_GetItemProperties_WhenNotHasViewBuilder_TypeDescriptorGetProperties()
        {
            //---------------Set up test pack-------------------
            var mockPageProvider = MockRepository.GenerateStub <PageProvider <FakeBO> >();
            var list             = new CachedBindingListViewSpy <FakeBO>(mockPageProvider);

            //---------------Assert Precondition----------------
            Assert.IsNull(list.ViewBuilder);
            //---------------Execute Test ----------------------
            var pds = list.GetItemProperties(new PropertyDescriptor[0]);
            //---------------Test Result -----------------------
            var propertyInfos = typeof(FakeBO).GetProperties();

            Assert.AreEqual(propertyInfos.Length, pds.Count);
        }
        public void Test_GetItemProperties_WhenHasViewBuilder_ShouldReturnViewBuidlersGetGridView()
        {
            //---------------Set up test pack-------------------
            var          mockPageProvider = MockRepository.GenerateStub <PageProvider <FakeBO> >();
            IViewBuilder viewBuilder      = MockRepository.GenerateStub <IViewBuilder>();

            viewBuilder.Stub(builder => builder.GetPropertyDescriptors()).Return(
                new PropertyDescriptorCollection(new PropertyDescriptor[0]));
            var list = new CachedBindingListViewSpy <FakeBO>(mockPageProvider)
            {
                ViewBuilder = viewBuilder
            };

            //---------------Assert Precondition----------------
            Assert.AreSame(viewBuilder, list.ViewBuilder);
            //---------------Execute Test ----------------------
            var pds = list.GetItemProperties(new PropertyDescriptor[0]);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, pds.Count);
        }