public void GivenPublicField_AndSortColumnIndexIs1_WhenInvokeSortSelector_ThenSortOnFieldType()
        {
            MockRequest.Expect(m => m["iSortCol_0"]).Return("1");
            string expected = "this is what I want!";
            PublicField customField = new PublicField { Name = "this is NOT what I want!!!!", CustomFieldType = new CustomFieldType { Name = expected } };
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            var actual = target.SortSelector.Compile().Invoke(customField);

            Assert.AreEqual(expected, actual);
        }
        public void GivenPublicField_WhenInvokeDataSelector_ThenIdPropertyMatches()
        {
            int expected = 7438095;
            PublicField customField = new PublicField
            {
                Id = expected,
                CustomFieldType = new CustomFieldType()
            };
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            dynamic actual = target.DataSelector.Compile().Invoke(customField);

            Assert.AreEqual(expected, actual.Id);
        }
        public void GivenPublicField_WhenInvokeDataSelector_ThenCategoriesPropertyMatches()
        {
            string[] expected = new[] { "category1", "category2", "category3" };
            PublicField customField = new PublicField
            {
                Categories = expected.Select(c => new CustomFieldCategory { Name = c }).ToList(),
                CustomFieldType = new CustomFieldType()
            };
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            dynamic actual = target.DataSelector.Compile().Invoke(customField);

            CollectionAssert.AreEqual(expected, ((IEnumerable<string>)actual.Categories).ToList());
        }
        public void GivenPublicField_WhenInvokeDataSelector_ThenTypePropertyMatches()
        {
            string expected = "field type";
            PublicField customField = new PublicField
            {
                CustomFieldType = new CustomFieldType { Name = expected }
            };
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            dynamic actual = target.DataSelector.Compile().Invoke(customField);

            Assert.AreEqual(expected, actual.Type);
        }
        public void GivenPrivateHealthField_WhenInvokeFilterPredicate_ThenReturnFalse()
        {
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            Assert.IsFalse(target.FilterPredicate.Compile().Invoke(new PrivateHealthField()));
        }
        public void GivenPublicField_WhenInvokeSortSelector_ThenSortOnName()
        {
            string expected = "this is what I want!";
            PublicField customField = new PublicField { Name = expected };
            PublicFieldClientDataTable target = new PublicFieldClientDataTable(MockRequest);

            var actual = target.SortSelector.Compile().Invoke(customField);

            Assert.AreEqual(expected, actual);
        }