public void GetView_SetsIsPartial(bool isPartial) { // Arrange var factory = new RazorViewFactory( Mock.Of<IRazorPageActivator>(), Mock.Of<IViewStartProvider>()); var page = Mock.Of<IRazorPage>(); var viewEngine = Mock.Of<IRazorViewEngine>(); // Act var view = factory.GetView(viewEngine, page, isPartial); // Assert var razorView = Assert.IsType<RazorView>(view); Assert.Same(page, razorView.RazorPage); Assert.Equal(razorView.IsPartial, isPartial); }
public void GetView_SetsIsPartial(bool isPartial) { // Arrange var factory = new RazorViewFactory( Mock.Of <IRazorPageActivator>(), Mock.Of <IViewStartProvider>()); var page = Mock.Of <IRazorPage>(); var viewEngine = Mock.Of <IRazorViewEngine>(); // Act var view = factory.GetView(viewEngine, page, isPartial); // Assert var razorView = Assert.IsType <RazorView>(view); Assert.Same(page, razorView.RazorPage); Assert.Equal(razorView.IsPartial, isPartial); }
public void GetView_SetsRazorPage() { // Arrange var factory = new RazorViewFactory( Mock.Of<IRazorPageActivator>(), Mock.Of<IViewStartProvider>()); var page = Mock.Of<IRazorPage>(); var viewEngine = Mock.Of<IRazorViewEngine>(); // Act var view = factory.GetView(viewEngine, page, isPartial: false); // Assert Assert.NotNull(view); var razorView = Assert.IsType<RazorView>(view); Assert.Same(razorView.RazorPage, page); }
public void GetView_SetsRazorPage() { // Arrange var factory = new RazorViewFactory( Mock.Of <IRazorPageActivator>(), Mock.Of <IViewStartProvider>()); var page = Mock.Of <IRazorPage>(); var viewEngine = Mock.Of <IRazorViewEngine>(); // Act var view = factory.GetView(viewEngine, page, isPartial: false); // Assert Assert.NotNull(view); var razorView = Assert.IsType <RazorView>(view); Assert.Same(razorView.RazorPage, page); }