Beispiel #1
0
        public SliderBuilder SliderFor <TProperty>(Expression <Func <TModel, TProperty> > expression)
        {
            SliderBuilder sliderBuilder = Slider();

            sliderBuilder.PrepareEditorFor(base.Html, expression);
            return(sliderBuilder);
        }
        public void Render_Begin_SetsDivWithAttributes()
        {
            actual = string.Empty;
            string        expected = "<div id=\"slider\" data-control-type=\"slider\"></div>";
            SliderBuilder target   = new SliderBuilder("slider");

            actual = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            Assert.AreEqual(expected, actual);
        }
        public void Constructor_SetsControls()
        {
            actual     = string.Empty;
            returnHtml = string.Empty;
            SliderBuilder target = new SliderBuilder("slider");

            returnHtml = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            actual     = Utility.GetAttribute(returnHtml, "data-control-bind-source", _startTag);
            Assert.AreEqual(string.Empty, actual);
        }
        public void Constructor_SetsTagName()
        {
            actual     = string.Empty;
            returnHtml = string.Empty;
            SliderBuilder target = new SliderBuilder("slider");

            returnHtml = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            actual     = Utility.GetTagName(returnHtml);
            Assert.AreEqual(_startTag, actual);
        }
        public void Constructor_SetsId()
        {
            actual     = string.Empty;
            returnHtml = string.Empty;
            SliderBuilder target = new SliderBuilder("slider");

            returnHtml = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            actual     = Utility.GetAttribute(returnHtml, "id", _startTag);
            Assert.AreEqual("slider", actual);
        }
        public void Render_Begin_SetsOptions()
        {
            actual = string.Empty;
            string        expected = "<div id=\"slider\" data-control-type=\"slider\" data-control-options=\"{&quot;disabled&quot;:true}\"></div>";
            SliderBuilder target   = new SliderBuilder("slider");

            target.Options(option => option.Disabled = true);
            actual = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            Assert.AreEqual(expected, actual);
        }
        public void Render_Begin_SetsBind()
        {
            actual = string.Empty;
            string        expected = "<div id=\"progressbar\" data-control-type=\"slider\" data-control-bind-source=\"{&quot;value&quot;:50}\"></div>";
            SliderBuilder target   = new SliderBuilder("progressbar");

            target.DataMap(item =>
            {
                item.Value = 50;
            });
            actual = Utility.ControlHtmlBuilder <Slider, SliderBuilder>(target);
            Assert.AreEqual(expected, actual);
        }
        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            foreach (var property in builder.Model.GetEntityTypes().SelectMany(t => t.GetProperties()).Where(p => p.ClrType == typeof(decimal)))
            {
                property.Relational().ColumnType = "decimal(18, 2)";
            }
            var brandBuilder            = new BrandBuilder(builder.Entity <Brand>());
            var colorBuilder            = new ColorBuilder(builder.Entity <Color>());
            var fileBuilder             = new FileBuilder(builder.Entity <File>());
            var languageBuilder         = new LanguageBuilder(builder.Entity <Language>());
            var pageBuilder             = new PageBuilder(builder.Entity <Page>());
            var postBuilder             = new PostBuilder(builder.Entity <Post>());
            var postCategoryBuilder     = new PostCategoryBuilder(builder.Entity <PostCategory>());
            var postPostCategoryBuilder = new PostPostCategoryBuilder(builder.Entity <PostPostCategory>());
            var productBuilder          = new ProductBuilder(builder.Entity <Product>());
            var productCategoryBuilder  = new ProductCategoryBuilder(builder.Entity <ProductCategory>());
            var productColorBuilder     = new ProductColorBuilder(builder.Entity <ProductColor>());
            var productPhotoBuilder     = new ProductPhotoBuilder(builder.Entity <ProductPhoto>());
            var reviewBuilder           = new ReviewBuilder(builder.Entity <Review>());
            var slideBuilder            = new SlideBuilder(builder.Entity <Slide>());
            var sliderBuilder           = new SliderBuilder(builder.Entity <Slider>());
            var advertisementBuilder    = new AdvertisementBuilder(builder.Entity <Advertisement>());
            var storeBuilder            = new StoreBuilder(builder.Entity <Store>());
            var storeBrandBuilder       = new StoreBrandBuilder(builder.Entity <StoreBrand>());
            var wishlistBuilder         = new WishlistBuilder(builder.Entity <Wishlist>());
            var orderBuilder            = new OrderBuilder(builder.Entity <Order>());
            var orderItemBuilder        = new OrderItemBuilder(builder.Entity <OrderItem>());
            var addressBuilder          = new AddressBuilder(builder.Entity <Address>());
            var cityBuilder             = new CityBuilder(builder.Entity <City>());
            var countryBuilder          = new CountryBuilder(builder.Entity <Country>());
            var couponBuilder           = new CouponBuilder(builder.Entity <Coupon>());
            var districtBuilder         = new DistrictBuilder(builder.Entity <District>());
            var productQuestionBuilder  = new ProductQuestionBuilder(builder.Entity <ProductQuestion>());
            var questionCategoryBuilder = new QuestionCategoryBuilder(builder.Entity <QuestionCategory>());
            var shipperBuilder          = new ShipperBuilder(builder.Entity <Shipper>());
            var cartBuilder             = new CartBuilder(builder.Entity <Cart>());
            var cartItemBuilder         = new CartItemBuilder(builder.Entity <CartItem>());

            // data seeding
            ApplicationDbContextSeed.Seed(builder);
        }
Beispiel #9
0
 public SliderBuilderTests()
 {
     component = SliderTestHelper.CreateSlider <int>(null, null);
     builder   = new SliderBuilder <int>(component);
 }
 public SliderBuilderTests()
 {
     component = SliderTestHelper.CreateSlider<int>(null, null);
     builder = new SliderBuilder<int>(component);
 }
 public SliderBuilderTests()
 {
     _slider = new Slider(new ViewContext(), new Mock<IClientSideObjectWriterFactory>().Object);
     _builder = new SliderBuilder(_slider);
 }