diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj
index deda4f5794..bb87abc83b 100644
--- a/src/Umbraco.Tests/Umbraco.Tests.csproj
+++ b/src/Umbraco.Tests/Umbraco.Tests.csproj
@@ -245,6 +245,7 @@
+
diff --git a/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs b/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs
new file mode 100644
index 0000000000..5ec039a4dd
--- /dev/null
+++ b/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs
@@ -0,0 +1,157 @@
+using System.Collections.Generic;
+using System.Globalization;
+using System.Web;
+using System.Web.Mvc;
+using System.Web.Routing;
+using Moq;
+using NUnit.Framework;
+using Umbraco.Core.Models;
+using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Web.Models;
+using Umbraco.Web.Mvc;
+
+namespace Umbraco.Tests.Web.Mvc
+{
+ [TestFixture]
+ public class RenderModelBinderTests
+ {
+ [Test]
+ public void Returns_Binder_For_IPublishedContent_And_IRenderModel()
+ {
+ var binder = new RenderModelBinder();
+ var found = binder.GetBinder(typeof (IPublishedContent));
+ Assert.IsNotNull(found);
+ found = binder.GetBinder(typeof(IRenderModel));
+ Assert.IsNotNull(found);
+ found = binder.GetBinder(typeof(RenderModel));
+ Assert.IsNotNull(found);
+ found = binder.GetBinder(typeof(DynamicPublishedContent));
+ Assert.IsNotNull(found);
+ found = binder.GetBinder(typeof(MyContent));
+ Assert.IsNotNull(found);
+
+ found = binder.GetBinder(typeof(MyOtherContent));
+ Assert.IsNull(found);
+ }
+
+ [Test]
+ public void BindModel_Null_Source_Returns_Null()
+ {
+ Assert.IsNull(RenderModelBinder.BindModel(null, typeof(MyContent), CultureInfo.CurrentCulture));
+ }
+
+ [Test]
+ public void BindModel_Returns_If_Same_Type()
+ {
+ var content = new MyContent(Mock.Of());
+ var bound = RenderModelBinder.BindModel(content, typeof (IPublishedContent), CultureInfo.CurrentCulture);
+ Assert.AreSame(content, bound);
+ }
+
+ [Test]
+ public void BindModel_RenderModel_To_IPublishedContent()
+ {
+ var content = new MyContent(Mock.Of());
+ var renderModel = new RenderModel(content, CultureInfo.CurrentCulture);
+ var bound = RenderModelBinder.BindModel(renderModel, typeof(IPublishedContent), CultureInfo.CurrentCulture);
+ Assert.AreSame(content, bound);
+ }
+
+ [Test]
+ public void BindModel_IPublishedContent_To_RenderModel()
+ {
+ var content = new MyContent(Mock.Of());
+ var bound = (IRenderModel)RenderModelBinder.BindModel(content, typeof(RenderModel), CultureInfo.CurrentCulture);
+ Assert.AreSame(content, bound.Content);
+ }
+
+ [Test]
+ public void BindModel_IPublishedContent_To_Generic_RenderModel()
+ {
+ var content = new MyContent(Mock.Of());
+ var bound = (IRenderModel)RenderModelBinder.BindModel(content, typeof(RenderModel), CultureInfo.CurrentCulture);
+ Assert.AreSame(content, bound.Content);
+ }
+
+ [Test]
+ public void No_DataToken_Returns_Null()
+ {
+ var binder = new RenderModelBinder();
+ var routeData = new RouteData();
+ var result = binder.BindModel(new ControllerContext(Mock.Of(), routeData, Mock.Of()),
+ new ModelBindingContext());
+
+ Assert.IsNull(result);
+ }
+
+ [Test]
+ public void Invalid_DataToken_Model_Type_Returns_Null()
+ {
+ var binder = new RenderModelBinder();
+ var routeData = new RouteData();
+ routeData.DataTokens[Core.Constants.Web.UmbracoDataToken] = "hello";
+
+ //the value provider is the default implementation
+ var valueProvider = new Mock();
+ //also IUnvalidatedValueProvider
+ var invalidatedValueProvider = valueProvider.As();
+ invalidatedValueProvider.Setup(x => x.GetValue(It.IsAny(), It.IsAny())).Returns(() =>
+ new ValueProviderResult(null, "", CultureInfo.CurrentCulture));
+
+ var controllerCtx = new ControllerContext(
+ Mock.Of(http => http.Items == new Dictionary