public void DisplayOptionEnum_Should_Be_Unknown_When_Not_set()
        {
            controllerContext = new ControllerContext(mockHttpContext.Object, new RouteData(), controllerBase.Object);

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

            richTextBlockController.DisplayOption.Should().Be(DisplayOptionEnum.Unknown);
        }
        public void GetDisplayOptionTag_Returns_TheCorrect_Enum(DisplayOptionEnum enumValue)
        {
            richTextBlockController = new BaseBlockController <RichTextBlock>();

            var classToMatch = enumValue.ToString();

            var result =
                richTextBlockController.GetDisplayOptionTag(classToMatch);

            result.Should().Be(enumValue);
        }
        public void DisplayOptionEnum_With_Empty_Tag_Routedata_Should_Be_Unknown()
        {
            var routeData = new RouteData();

            routeData.Values.Add(GlobalConstants.ViewBagProperties.RenderSettings, new Dictionary <string, object>());

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

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

            richTextBlockController.DisplayOption.Should().Be(DisplayOptionEnum.Unknown);
        }
        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);
        }
 public void EpiserverContentRepositories_Sets_Correctly()
 {
     richTextBlockController = new BaseBlockController <RichTextBlock>();
     richTextBlockController.EpiserverContentRepositories.Should().NotBeNull();
 }
 public void WebsiteDependencies_Sets_Correctly()
 {
     richTextBlockController = new BaseBlockController <RichTextBlock>();
     richTextBlockController.WebsiteDependencies.Should().NotBeNull();
 }