public void ContentType2_To_ContentType1() { var content = new ContentType2(null, Mock.Of <IPublishedValueFallback>()); var view = new ContentType1TestPage(); var viewData = GetViewDataDictionary(content); view.SetViewData(viewData); Assert.IsInstanceOf <ContentType1>(view.Model); }
public void RenderModelOf_ContentType1_To_ContentType1() { var content = new ContentType1(null, Mock.Of <IPublishedValueFallback>()); var model = new ContentModel <ContentType1>(content); var view = new ContentType1TestPage(); ViewDataDictionary <ContentModel <ContentType1> > viewData = GetViewDataDictionary <ContentModel <ContentType1> >(model); view.SetViewData(viewData); Assert.IsInstanceOf <ContentType1>(view.Model); }
public void RenderModelOf_ContentType2_To_ContentType1() { var content = new ContentType2(null, Mock.Of <IPublishedValueFallback>()); var model = new ContentModel <ContentType2>(content); var view = new ContentType1TestPage(); var viewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), new ModelStateDictionary()) { Model = model }; view.SetViewData(viewData); Assert.IsInstanceOf <ContentType1>(view.Model); }