Inheritance: Controller, IRequiresRoutableRequestContext
コード例 #1
0
        public void MediaProxyController_Proxy_Returns_404_For_Empty_Id()
        {
            //Arrange
            var controller = new MediaProxyController(_backOfficeRequestContext);
            controller.InjectDependencies(new Dictionary<string, string>(), new Dictionary<string, string>(), _backOfficeRequestContext, false);

            var result = controller.Proxy("rebelFile", "", 0, "test.jpg");

            //Assert
            Assert.IsTrue(result is HttpNotFoundResult);
        }
コード例 #2
0
        public void MediaProxyController_Proxy_Returns_File_Content_For_Thumbnail()
        {
            //Arrange
            var controller = new MediaProxyController(_backOfficeRequestContext);
            controller.InjectDependencies(new Dictionary<string, string>(), new Dictionary<string, string>(), _backOfficeRequestContext, false);

            var result = controller.Proxy("rebelFile", "0A647849-BF5C-413B-9420-7AB4C9521505", 100, "test.jpg");

            //Assert
            Assert.IsTrue(result is FileContentResult);
            Assert.IsTrue(Encoding.UTF8.GetString(((FileContentResult)result).FileContents) == "test_100");
        }
コード例 #3
0
        public void MediaProxyController_Proxy_Returns_404_For_Invalid_Property_Alias()
        {
            //Arrange
            var controller = new MediaProxyController(_backOfficeRequestContext);
            controller.InjectDependencies(new Dictionary<string, string>(), new Dictionary<string, string>(), _backOfficeRequestContext, false);

            var result = controller.Proxy("invalidPropertyAlias", "0A647849-BF5C-413B-9420-7AB4C9521505", 0, "test.jpg");

            //Assert
            Assert.IsTrue(result is HttpNotFoundResult);
        }