From 823229279af0b5c2348a2ccf8924510b13427c77 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Fri, 21 Nov 2014 09:25:13 -0800 Subject: [PATCH] Extend MVC Sample functional test to include all Home views --- .../MvcSampleTests.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcSampleTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcSampleTests.cs index 01176a3865..d65493b00f 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcSampleTests.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcSampleTests.cs @@ -20,8 +20,20 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests TestHelper.CreateServices("MvcSample.Web", Path.Combine("..", "..", "samples")); private readonly Action _app = new MvcSample.Web.Startup().Configure; - [Fact] - public async Task Home_Index_ReturnsSuccess() + [Theory] + [InlineData("")] // Shared/MyView.cshtml + [InlineData("/")] // Shared/MyView.cshtml + [InlineData("/Home/Index")] // Shared/MyView.cshtml + [InlineData("/Home/Create")] // Home/Create.cshtml + [InlineData("/Home/FlushPoint")] // Home/FlushPoint.cshtml + [InlineData("/Home/InjectSample")] // Home/InjectSample.cshtml + [InlineData("/Home/Language")] // Home/Language.cshtml + [InlineData("/Home/MyView")] // Shared/MyView.cshtml + [InlineData("/Home/NullUser")] // Home/NullUser.cshtml + [InlineData("/Home/Post")] // Shared/MyView.cshtml with null User + [InlineData("/Home/SaveUser")] // Shared/MyView.cshtml with uninitialized User instance + [InlineData("/Home/ValidationSummary")] // Home/ValidationSummary.cshtml + public async Task Home_Pages_ReturnSuccess(string path) { using (TestHelper.ReplaceCallContextServiceLocationService(_services)) { @@ -30,7 +42,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var client = server.CreateClient(); // Act - var response = await client.GetAsync("http://localhost/Home/Index"); + var response = await client.GetAsync("http://localhost" + path); // Assert Assert.NotNull(response);