Example #1
0
        public void GetFilterOptions_ForBoolean()
        {
            SelectListItem[] actual = filters.GetFilterOptions <GridModel, Boolean>(null).ToArray();

            Assert.Equal(3, actual.Length);
            Assert.Equal("", actual[0].Value);
            Assert.Equal("true", actual[1].Value);
            Assert.Equal("false", actual[2].Value);
            Assert.Equal(filters.BooleanEmptyOptionText(), actual[0].Text);
            Assert.Equal(filters.BooleanTrueOptionText(), actual[1].Text);
            Assert.Equal(filters.BooleanFalseOptionText(), actual[2].Text);
        }
Example #2
0
        public void OptionsFor_ForBoolean()
        {
            SelectListItem[] actual = filters.OptionsFor(Substitute.For <IGridColumn <GridModel, Boolean> >()).ToArray();

            Assert.Equal(3, actual.Length);
            Assert.Equal("", actual[0].Value);
            Assert.Equal("true", actual[1].Value);
            Assert.Equal("false", actual[2].Value);
            Assert.Equal(filters.BooleanTrueOptionText(), actual[1].Text);
            Assert.Equal(filters.BooleanEmptyOptionText(), actual[0].Text);
            Assert.Equal(filters.BooleanFalseOptionText(), actual[2].Text);
        }