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.
This commit is contained in:
Praburaj 2015-01-02 17:13:31 -08:00
parent 14ec7960a1
commit 6407ff0adc
20 changed files with 60 additions and 56 deletions

View File

@ -4,11 +4,11 @@
{
if (input.Length <= length)
{
@input
@input
}
else
{
@input.Substring(0, length)<text>...</text>
@input.Substring(0, length)<text>...</text>
}
}
@ -40,25 +40,25 @@
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Genre.Name)
</td>
<td>
@Truncate(item.Artist.Name, 25)
</td>
<td>
@Truncate(item.Title, 25)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.AlbumId }) |
@Html.ActionLink("Details", "Details", new { id = item.AlbumId }) |
@Html.ActionLink("Delete", "RemoveAlbum", new { id = item.AlbumId })
</td>
</tr>
<tr>
<td>
@Html.DisplayFor(modelItem => item.Genre.Name)
</td>
<td>
@Truncate(item.Artist.Name, 25)
</td>
<td>
@Truncate(item.Title, 25)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.AlbumId }) |
@Html.ActionLink("Details", "Details", new { id = item.AlbumId }) |
@Html.ActionLink("Delete", "RemoveAlbum", new { id = item.AlbumId })
</td>
</tr>
}
</table>

View File

@ -1 +0,0 @@
# Mock code added only for testing purposes. Not to be used for production deployments.

View File

@ -5,7 +5,8 @@
<h2>@ViewBag.Title.</h2>
@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)
<h4>Send verification code</h4>

View File

@ -1,20 +1,19 @@
@model IEnumerable<MusicStore.Models.Genre>
<li class="dropdown">
<a href="@Url.Action("Index", "Store")" class="dropdown-toggle" data-toggle="dropdown">Store <b class="caret"></b></a>
<ul class="dropdown-menu">
@foreach (var genre in Model)
{
<li>
@Html.ActionLink(genre.Name,
<li class="dropdown">
<a href="@Url.Action("Index", "Store")" class="dropdown-toggle" data-toggle="dropdown">Store <b class="caret"></b></a>
<ul class="dropdown-menu">
@foreach (var genre in Model)
{
<li>
@Html.ActionLink(genre.Name,
"Browse", "Store",
new { Genre = genre.Name }, null)
</li>
}
<li class="divider"></li>
<li>
@Html.ActionLink("More...", "Index", "Store")
</li>
</li>
}
<li class="divider"></li>
<li>
@Html.ActionLink("More...", "Index", "Store")
</li>
</ul>
</li>
</li>

View File

@ -68,24 +68,24 @@
</tr>
@foreach (var item in Model.CartItems)
{
<tr id="row-@item.CartItemId">
<td>
@Html.ActionLink(item.Album.Title,
<tr id="row-@item.CartItemId">
<td>
@Html.ActionLink(item.Album.Title,
"Details", "Store", new { id = item.AlbumId }, null)
</td>
<td>
@item.Album.Price
</td>
<td id="item-count-@item.CartItemId">
@item.Count
</td>
<td>
<a href="#" class="RemoveLink" data-id="@item.CartItemId"
data-url='@Url.Content("~/ShoppingCart/RemoveFromCart")'>
Remove from cart
</a>
</td>
</tr>
</td>
<td>
@item.Album.Price
</td>
<td id="item-count-@item.CartItemId">
@item.Count
</td>
<td>
<a href="#" class="RemoveLink" data-id="@item.CartItemId"
data-url='@Url.Content("~/ShoppingCart/RemoveFromCart")'>
Remove from cart
</a>
</td>
</tr>
}
<tr>
<td>

View File

@ -6,7 +6,7 @@
<h3>
<em>@Model.Name</em> Albums
</h3>
<ul id="album-list" class="list-unstyled">
@foreach (var album in Model.Albums)
{

View File

@ -5,11 +5,12 @@
"description": "Music store application on ASP.NET 5",
"version": "1.0.0-*",
"compilationOptions": { "warningsAsErrors": true, "define": [ "DEMO", "TESTING" ] },
"code": [ "**/*.cs", "../../test/E2ETests/compiler/shared/**/*.cs" ], // Code from ../../test/E2ETests/compiler/shared folder is for testing only.
"packExclude": "*.cmd",
"webroot": "wwwroot",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-*",
"EntityFramework.InMemory": "7.0.0-*", //For Mono
"EntityFramework.InMemory": "7.0.0-*", // For Mono.
"Kestrel": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-*",

View File

@ -0,0 +1,4 @@
# Mock code added only for testing purposes. Not to be used for production deployments.
This code is compiled with the application by explicitly including the location in the application `project.json`'s "code" node.
It is automatically excluded from compilation of current project by its presence in the compiler\shared\** special folder.