Skip to content

Commit ff240fb

Browse files
committed
Added a very simple sample app
1 parent d18efc1 commit ff240fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+34192
-0
lines changed

FluentAssertionsMvc.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FluentAssertions.AspNetCore
4646
EndProject
4747
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FluentAssertions.AspNetCore.Mvc.Tests", "tests\FluentAssertions.AspNetCore.Mvc.Tests\FluentAssertions.AspNetCore.Mvc.Tests.xproj", "{9F29BCB2-B780-49E0-8F16-EE2572AF1BBD}"
4848
EndProject
49+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FluentAssertions.AspNetCore.Mvc.Sample", "samples\FluentAssertions.AspNetCore.Mvc.Sample\FluentAssertions.AspNetCore.Mvc.Sample.xproj", "{8156D339-E8DE-4A68-8828-9DA927D2949D}"
50+
EndProject
4951
Global
5052
GlobalSection(SharedMSBuildProjectFiles) = preSolution
5153
src\FluentAssertions.Mvc.Shared\FluentAssertions.Mvc.Shared.projitems*{0e46fc22-eb6a-431e-bfb3-47fbc4fc500f}*SharedItemsImports = 13
@@ -158,6 +160,18 @@ Global
158160
{9F29BCB2-B780-49E0-8F16-EE2572AF1BBD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
159161
{9F29BCB2-B780-49E0-8F16-EE2572AF1BBD}.Release|x86.ActiveCfg = Release|Any CPU
160162
{9F29BCB2-B780-49E0-8F16-EE2572AF1BBD}.Release|x86.Build.0 = Release|Any CPU
163+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
164+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|Any CPU.Build.0 = Debug|Any CPU
165+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
166+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
167+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|x86.ActiveCfg = Debug|Any CPU
168+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Debug|x86.Build.0 = Debug|Any CPU
169+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|Any CPU.ActiveCfg = Release|Any CPU
170+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|Any CPU.Build.0 = Release|Any CPU
171+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
172+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
173+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|x86.ActiveCfg = Release|Any CPU
174+
{8156D339-E8DE-4A68-8828-9DA927D2949D}.Release|x86.Build.0 = Release|Any CPU
161175
EndGlobalSection
162176
GlobalSection(SolutionProperties) = preSolution
163177
HideSolutionNode = FALSE
@@ -174,5 +188,6 @@ Global
174188
{AEEA0A6D-F5B6-42DB-9AF0-82164ECCA21B} = {A4C33565-1E6E-4AE7-8F02-1911DBA00263}
175189
{EA71D220-089E-4CB1-B187-D9BB4DFD8624} = {89B09C65-4F1E-4B5A-AD58-E244113F2C02}
176190
{9F29BCB2-B780-49E0-8F16-EE2572AF1BBD} = {A4C33565-1E6E-4AE7-8F02-1911DBA00263}
191+
{8156D339-E8DE-4A68-8828-9DA927D2949D} = {4E91D524-3DC0-4E08-82FE-6FDAEB89212B}
177192
EndGlobalSection
178193
EndGlobal
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "wwwroot/lib"
3+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
namespace FluentAssertions.AspNetCore.Mvc.Sample.Controllers
8+
{
9+
public class HomeController : Controller
10+
{
11+
public IActionResult Index()
12+
{
13+
return View();
14+
}
15+
16+
public IActionResult About()
17+
{
18+
ViewData["Message"] = "Your application description page.";
19+
20+
return View();
21+
}
22+
23+
public IActionResult Contact()
24+
{
25+
ViewData["Message"] = "Your contact page.";
26+
27+
return View();
28+
}
29+
30+
public IActionResult Error()
31+
{
32+
return View();
33+
}
34+
}
35+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
8+
9+
namespace FluentAssertions.AspNetCore.Mvc.Sample.Controllers
10+
{
11+
public class ProductController : Controller
12+
{
13+
// GET: /<controller>/
14+
public IActionResult List()
15+
{
16+
return View("Index");
17+
}
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>8156d339-e8de-4a68-8828-9da927d2949d</ProjectGuid>
10+
<RootNamespace>FluentAssertions.AspNetCore.Mvc.Sample</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14+
</PropertyGroup>
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<ItemGroup>
19+
<DnxInvisibleContent Include="bower.json" />
20+
<DnxInvisibleContent Include=".bowerrc" />
21+
</ItemGroup>
22+
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
23+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace FluentAssertions.AspNetCore.Mvc.Sample.Models
7+
{
8+
public class ProductViewModel
9+
{
10+
public int Id { get; set; }
11+
public string Name { get; set; }
12+
}
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Hosting;
7+
8+
namespace FluentAssertions.AspNetCore.Mvc.Sample
9+
{
10+
public class Program
11+
{
12+
public static void Main(string[] args)
13+
{
14+
var host = new WebHostBuilder()
15+
.UseKestrel()
16+
.UseContentRoot(Directory.GetCurrentDirectory())
17+
.UseIISIntegration()
18+
.UseStartup<Startup>()
19+
.Build();
20+
21+
host.Run();
22+
}
23+
}
24+
}
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Welcome to ASP.NET Core</title>
6+
<style>
7+
html {
8+
background: #f1f1f1;
9+
height: 100%;
10+
}
11+
12+
body {
13+
background: #fff;
14+
color: #505050;
15+
font: 14px 'Segoe UI', tahoma, arial, helvetica, sans-serif;
16+
margin: 1%;
17+
min-height: 95.5%;
18+
border: 1px solid silver;
19+
position: relative;
20+
}
21+
22+
#header {
23+
padding: 0;
24+
}
25+
26+
#header h1 {
27+
font-size: 44px;
28+
font-weight: normal;
29+
margin: 0;
30+
padding: 10px 30px 10px 30px;
31+
}
32+
33+
#header span {
34+
margin: 0;
35+
padding: 0 30px;
36+
display: block;
37+
}
38+
39+
#header p {
40+
font-size: 20px;
41+
color: #fff;
42+
background: #007acc;
43+
padding: 0 30px;
44+
line-height: 50px;
45+
margin-top: 25px;
46+
47+
}
48+
49+
#header p a {
50+
color: #fff;
51+
text-decoration: underline;
52+
font-weight: bold;
53+
padding-right: 35px;
54+
background: no-repeat right bottom url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAMAAAAcqPc3AAAANlBMVEUAAAAAeswfitI9mthXp91us+KCvuaTx+mjz+2x1u+83PLH4vTR5/ba7Pjj8Pns9fv1+v3////wy3dWAAAAAXRSTlMAQObYZgAAAHxJREFUeNp9kVcSwCAIRMHUYoH7XzaxOxJ9P8oyQ1uIqNPwh3s2aLmIM2YtqrLcQIeQEylhuCeUOlhgve5yoBCfWmlnlgkN4H8ykbpaE7gR03AbUHiwoOxUH9Xp+ubd41p1HF3mBPrfC87BHeTdaB3ceeKL9HGpcvX9zu6+DdMWT9KQPvYAAAAASUVORK5CYII=);
55+
}
56+
57+
#main {
58+
padding: 5px 30px;
59+
clear: both;
60+
}
61+
62+
.section {
63+
width: 21.7%;
64+
float: left;
65+
margin: 0 0 0 4%;
66+
}
67+
68+
.section h2 {
69+
font-size: 13px;
70+
text-transform: uppercase;
71+
margin: 0;
72+
border-bottom: 1px solid silver;
73+
padding-bottom: 12px;
74+
margin-bottom: 8px;
75+
}
76+
77+
.section.first {
78+
margin-left: 0;
79+
}
80+
81+
.section.first h2 {
82+
font-size: 24px;
83+
text-transform: none;
84+
margin-bottom: 25px;
85+
border: none;
86+
}
87+
88+
.section.first li {
89+
border-top: 1px solid silver;
90+
padding: 8px 0;
91+
}
92+
93+
.section.last {
94+
margin-right: 0;
95+
}
96+
97+
ul {
98+
list-style: none;
99+
padding: 0;
100+
margin: 0;
101+
line-height: 20px;
102+
}
103+
104+
li {
105+
padding: 4px 0;
106+
}
107+
108+
a {
109+
color: #267cb2;
110+
text-decoration: none;
111+
}
112+
113+
a:hover {
114+
text-decoration: underline;
115+
}
116+
117+
#footer {
118+
clear: both;
119+
padding-top: 50px;
120+
}
121+
122+
#footer p {
123+
position: absolute;
124+
bottom: 10px;
125+
}
126+
</style>
127+
</head>
128+
<body>
129+
130+
<div id="header">
131+
<h1>Welcome to ASP.NET Core</h1>
132+
<span>
133+
We've made some big updates in this release, so it’s <b>important</b> that you spend
134+
a few minutes to learn what’s new.
135+
</span>
136+
<p>You've created a new ASP.NET Core project. <a href="http://go.microsoft.com/fwlink/?LinkId=518016">Learn what's new</a></p>
137+
</div>
138+
139+
<div id="main">
140+
<div class="section first">
141+
<h2>This application consists of:</h2>
142+
<ul>
143+
<li>Sample pages using ASP.NET Core MVC</li>
144+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li>
145+
<li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
146+
</ul>
147+
</div>
148+
<div class="section">
149+
<h2>How to</h2>
150+
<ul>
151+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
152+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li>
153+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
154+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
155+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
156+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li>
157+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
158+
</ul>
159+
</div>
160+
<div class="section">
161+
<h2>Overview</h2>
162+
<ul>
163+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
164+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
165+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
166+
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
167+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
168+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
169+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
170+
</ul>
171+
</div>
172+
<div class="section last">
173+
<h2>Run & Deploy</h2>
174+
<ul>
175+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
176+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
177+
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
178+
</ul>
179+
</div>
180+
181+
<div id="footer">
182+
<p>We would love to hear your <a href="http://go.microsoft.com/fwlink/?LinkId=518015">feedback</a></p>
183+
</div>
184+
</div>
185+
186+
</body>
187+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:11185/",
7+
"sslPort": 0
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"FluentAssertions.AspNetCore.Mvc.Sample": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"launchUrl": "http://localhost:5000",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
}
25+
}
26+
}
27+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using FluentAssertions.AspNetCore.Mvc.Sample.Models;
2+
using System.Collections.Generic;
3+
4+
namespace FluentAssertions.Mvc.Samples.Services
5+
{
6+
public interface IProductService
7+
{
8+
IEnumerable<ProductViewModel> GetProducts();
9+
}
10+
}

0 commit comments

Comments
 (0)