From 6407ff0adc3187f7172fa7b1ccec4237cb747244 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Fri, 2 Jan 2015 17:13:31 -0800 Subject: [PATCH] Cleanup : Moving the mock code to the test project This is to make the sample code cleaner. Moved the mock code to the test project. Also fixed some intendation issues in some cshtml files. --- .../Admin/Views/StoreManager/Index.cshtml | 42 +++++++++---------- src/MusicStore/Mocks/Readme.md | 1 - src/MusicStore/Views/Account/SendCode.cshtml | 3 +- .../Components/GenreMenu/Default.cshtml | 27 ++++++------ .../Views/ShoppingCart/Index.cshtml | 34 +++++++-------- src/MusicStore/Views/Store/Browse.cshtml | 2 +- src/MusicStore/project.json | 3 +- .../Mocks/Common/CustomStateDataFormat.cs | 0 .../compiler/shared}/Mocks/Common/Helpers.cs | 0 .../FacebookMockBackChannelHttpHandler.cs | 0 .../Mocks/Facebook/FacebookNotifications.cs | 0 .../GoogleMockBackChannelHttpHandler.cs | 0 .../Mocks/Google/GoogleNotifications.cs | 0 .../MicrosoftAccountMockBackChannelHandler.cs | 0 .../MicrosoftAccountNotifications.cs | 0 test/E2ETests/compiler/shared/Mocks/Readme.md | 4 ++ .../shared}/Mocks/StartupSocialTesting.cs | 0 .../Twitter/CustomTwitterStateDataFormat.cs | 0 .../TwitterMockBackChannelHttpHandler.cs | 0 .../Mocks/Twitter/TwitterNotifications.cs | 0 20 files changed, 60 insertions(+), 56 deletions(-) delete mode 100644 src/MusicStore/Mocks/Readme.md rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Common/CustomStateDataFormat.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Common/Helpers.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Facebook/FacebookMockBackChannelHttpHandler.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Facebook/FacebookNotifications.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Google/GoogleMockBackChannelHttpHandler.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Google/GoogleNotifications.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/MicrosoftAccount/MicrosoftAccountMockBackChannelHandler.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/MicrosoftAccount/MicrosoftAccountNotifications.cs (100%) create mode 100644 test/E2ETests/compiler/shared/Mocks/Readme.md rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/StartupSocialTesting.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Twitter/CustomTwitterStateDataFormat.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Twitter/TwitterMockBackChannelHttpHandler.cs (100%) rename {src/MusicStore => test/E2ETests/compiler/shared}/Mocks/Twitter/TwitterNotifications.cs (100%) diff --git a/src/MusicStore/Areas/Admin/Views/StoreManager/Index.cshtml b/src/MusicStore/Areas/Admin/Views/StoreManager/Index.cshtml index 59a3f2798c..4a4f30ab1e 100644 --- a/src/MusicStore/Areas/Admin/Views/StoreManager/Index.cshtml +++ b/src/MusicStore/Areas/Admin/Views/StoreManager/Index.cshtml @@ -4,11 +4,11 @@ { if (input.Length <= length) { - @input + @input } else { - @input.Substring(0, length)... + @input.Substring(0, length)... } } @@ -40,25 +40,25 @@ @foreach (var item in Model) { - - - @Html.DisplayFor(modelItem => item.Genre.Name) - - - @Truncate(item.Artist.Name, 25) - - - @Truncate(item.Title, 25) - - - @Html.DisplayFor(modelItem => item.Price) - - - @Html.ActionLink("Edit", "Edit", new { id = item.AlbumId }) | - @Html.ActionLink("Details", "Details", new { id = item.AlbumId }) | - @Html.ActionLink("Delete", "RemoveAlbum", new { id = item.AlbumId }) - - + + + @Html.DisplayFor(modelItem => item.Genre.Name) + + + @Truncate(item.Artist.Name, 25) + + + @Truncate(item.Title, 25) + + + @Html.DisplayFor(modelItem => item.Price) + + + @Html.ActionLink("Edit", "Edit", new { id = item.AlbumId }) | + @Html.ActionLink("Details", "Details", new { id = item.AlbumId }) | + @Html.ActionLink("Delete", "RemoveAlbum", new { id = item.AlbumId }) + + } \ No newline at end of file diff --git a/src/MusicStore/Mocks/Readme.md b/src/MusicStore/Mocks/Readme.md deleted file mode 100644 index c8ef0bd928..0000000000 --- a/src/MusicStore/Mocks/Readme.md +++ /dev/null @@ -1 +0,0 @@ -# Mock code added only for testing purposes. Not to be used for production deployments. \ No newline at end of file diff --git a/src/MusicStore/Views/Account/SendCode.cshtml b/src/MusicStore/Views/Account/SendCode.cshtml index aa3395fa9d..1752f96d57 100644 --- a/src/MusicStore/Views/Account/SendCode.cshtml +++ b/src/MusicStore/Views/Account/SendCode.cshtml @@ -5,7 +5,8 @@

@ViewBag.Title.

-@using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { +@using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) +{ @Html.AntiForgeryToken() @Html.Hidden("rememberMe", @Model.RememberMe)

Send verification code

diff --git a/src/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml b/src/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml index 23d99215e5..cd9ed4491e 100644 --- a/src/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml +++ b/src/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml @@ -1,20 +1,19 @@ @model IEnumerable -