Ejemplo n.º 1
0
 public VideoBlockViewModel(
     VideoBlock currentBlock,
     IWebsiteDependencies _websiteDependencies,
     DisplayOptionEnum displayOptionTag)
     : base(currentBlock, _websiteDependencies, displayOptionTag)
 {
 }
        public void DisplayOptions_Works(DisplayOptionEnum param)
        {
            var mockDependencies = new Mock <IWebsiteDependencies>();

            baseViewModel = new BlockViewModel <RichTextBlock>(dummyBlock, mockDependencies.Object, param);
            baseViewModel.DisplayOptionTag.Should().Be(param);
        }
Ejemplo n.º 3
0
        public static string GetDisplayOptionsTag(DisplayOptionEnum value)
        {
            var displayOptionName
                = value.GetAttributeOfEnumValue <DisplayOptionNameAttribute>().ToString();

            return(displayOptionName);
        }
        public void DisplayOptions_Class_Name_Works(DisplayOptionEnum param)
        {
            var mockDependencies = new Mock <IWebsiteDependencies>();

            baseViewModel = new BlockViewModel <RichTextBlock>(dummyBlock, mockDependencies.Object, param);
            baseViewModel.GetBootstrapClass().Should()
            .Be(param.GetAttributeOfEnumValue <BootstrapClassAttribute>().Name);
        }
        public BlockViewModel(
            T currentBlock,
            IWebsiteDependencies _websiteDependencies,
            DisplayOptionEnum displayOptionTag)
        {
            Guard.ValidateObject(currentBlock);
            Guard.ValidateObject(_websiteDependencies);
            Guard.ValidateObject(displayOptionTag);

            WebsiteDependencies = _websiteDependencies;
            DisplayOptionTag    = displayOptionTag;
            CurrentBlock        = currentBlock;
        }
        public void DisplayOptionEnum_With_Correct_Tag_Routedata_Should_Set_Correctly(DisplayOptionEnum enumValue)
        {
            var dictionary = new Dictionary <string, object>();

            dictionary.Add(GlobalConstants.ViewBagProperties.Tag, enumValue.ToString());

            var routeData = new RouteData();

            routeData.Values.Add(GlobalConstants.ViewBagProperties.RenderSettings, dictionary);

            controllerContext = new ControllerContext(mockHttpContext.Object, routeData, controllerBase.Object);

            richTextBlockController = new BaseBlockController <RichTextBlock>();
            richTextBlockController.ControllerContext = controllerContext;

            richTextBlockController.DisplayOption.Should().Be(enumValue);
        }
Ejemplo n.º 7
0
 public NestedDonutBlockViewModel(NestedDonutBlock currentBlock,
                                  IEpiServerDependencies epiServerDependencies,
                                  DisplayOptionEnum displayOptionTag)
     : base(currentBlock, epiServerDependencies, displayOptionTag)
 {
 }
Ejemplo n.º 8
0
 public ColourBlockViewModel(ColourBlock currentBlock, IEpiServerDependencies epiServerDependencies, DisplayOptionEnum displayOptionTag)
     : base(currentBlock, epiServerDependencies, displayOptionTag)
 {
 }
 public DonutTwoExampleBlockViewModel(DonutTwoExampleBlock currentBlock, IEpiServerDependencies epiServerDependencies, DisplayOptionEnum displayOptionTag)
     : base(currentBlock, epiServerDependencies, displayOptionTag)
 {
 }