コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }