From a67bd6820ca3ec265ca830406f8d776b5ee5ccbf Mon Sep 17 00:00:00 2001 From: Praburaj Date: Thu, 4 Dec 2014 14:35:32 -0800 Subject: [PATCH] Adding some coverage for the .Include EF statements --- test/E2ETests/Scenarios.cs | 10 ++++++++++ test/E2ETests/SmokeTests.cs | 3 +++ 2 files changed, 13 insertions(+) diff --git a/test/E2ETests/Scenarios.cs b/test/E2ETests/Scenarios.cs index d8abbc2fda..bd34280714 100644 --- a/test/E2ETests/Scenarios.cs +++ b/test/E2ETests/Scenarios.cs @@ -335,6 +335,16 @@ namespace E2ETests Assert.Contains("Back to List", responseContent, StringComparison.OrdinalIgnoreCase); } + // This gets the view that non-admin users get to see. + private void GetAlbumDetailsFromStore(string albumId, string albumName) + { + Console.WriteLine("Getting details of album with Id '{0}'", albumId); + var response = httpClient.GetAsync(string.Format("Store/Details/{0}", albumId)).Result; + ThrowIfResponseStatusNotOk(response); + var responseContent = response.Content.ReadAsStringAsync().Result; + Assert.Contains(albumName, responseContent, StringComparison.OrdinalIgnoreCase); + } + private void AddAlbumToCart(string albumId, string albumName) { Console.WriteLine("Adding album id '{0}' to the cart", albumId); diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index 933f10c66f..dc06396fe4 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -149,6 +149,9 @@ namespace E2ETests //Get details of the album VerifyAlbumDetails(albumId, albumName); + //Get the non-admin view of the album. + GetAlbumDetailsFromStore(albumId, albumName); + //Add an album to cart and checkout the same AddAlbumToCart(albumId, albumName); CheckOutCartItems();