From 245d1dffdaf4a646a94e01ac952333e73353af19 Mon Sep 17 00:00:00 2001 From: ianhong Date: Wed, 12 Nov 2014 17:12:28 -0800 Subject: [PATCH] Updating the summary comment for IRazorViewFactory and its tests per comments --- .../IRazorViewFactory.cs | 4 +-- .../RazorViewFactoryTest.cs | 32 ++++--------------- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewFactory.cs b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewFactory.cs index e81d5ee45a..91cb4c73c2 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewFactory.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewFactory.cs @@ -13,9 +13,9 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// Creates a providing it with the to execute. /// - /// The instance to execute. + /// The instance to execute. /// Determines if the view is to be executed as a partial. - /// The IRazorPage instance if it exists, null otherwise. + /// A instance that renders the contents of the specified IView GetView([NotNull] IRazorPage page, bool isPartial); } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewFactoryTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewFactoryTest.cs index bbc232285e..27849b1fae 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewFactoryTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewFactoryTest.cs @@ -15,8 +15,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Test public class RazorViewFactoryTest { - [Fact] - public void GetView_SetsIsPartial() + [Theory] + [InlineData(false)] + [InlineData(true)] + public void GetView_SetsIsPartial(bool isPartial) { // Arrange var factory = new RazorViewFactory( @@ -25,14 +27,11 @@ namespace Microsoft.AspNet.Mvc.Razor.Test Mock.Of()); // Act - var viewPartial = factory.GetView(Mock.Of(), isPartial: true) as RazorView; - var view = factory.GetView(Mock.Of(), isPartial: false) as RazorView; + var view = factory.GetView(Mock.Of(), isPartial); // Assert - Assert.NotNull(viewPartial); - Assert.True(viewPartial.IsPartial); - Assert.NotNull(view); - Assert.True(!view.IsPartial); + var razorView = Assert.IsType(view); + Assert.Equal(razorView.IsPartial, isPartial); } [Fact] @@ -53,22 +52,5 @@ namespace Microsoft.AspNet.Mvc.Razor.Test Assert.NotNull(view); Assert.Same(view.RazorPage, page); } - - [Fact] - public void GetView_ReturnsRazorView() - { - // Arrange - var factory = new RazorViewFactory( - Mock.Of(), - Mock.Of(), - Mock.Of()); - - // Act - var view = factory.GetView(Mock.Of(), isPartial: true); - - // Assert - Assert.IsType(view); - } - } } \ No newline at end of file