-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74dddd9
commit 5eb8abc
Showing
20 changed files
with
391 additions
and
110 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
Templates/Website-MVC-Razor/$safeprojectname$.Tests/$safeprojectname$.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
|
||
<TargetFramework>net8.0</TargetFramework> | ||
|
||
<LangVersion>10.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
|
||
<IsPackable>false</IsPackable> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
|
||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
|
||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" /> | ||
|
||
<PackageReference Include="GenHTTP.Testing" Version="8.1.0" /> | ||
|
||
<ProjectReference Include="..\$safeprojectname$\$safeprojectname$.csproj" /> | ||
|
||
</ItemGroup> | ||
|
||
</Project> |
27 changes: 27 additions & 0 deletions
27
Templates/Website-MVC-Razor/$safeprojectname$.Tests/BookControllerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
using GenHTTP.Testing; | ||
|
||
namespace $safeprojectname$.Tests | ||
{ | ||
|
||
[TestClass] | ||
public class BookControllerTests | ||
{ | ||
|
||
[TestMethod] | ||
public async Task TestCanFetchBooks() | ||
{ | ||
using var runner = TestHost.Run(Project.Create()); | ||
|
||
using var response = await runner.GetResponseAsync("/books/"); | ||
|
||
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using GenHTTP.Api.Content; | ||
|
||
using GenHTTP.Modules.Controllers; | ||
using GenHTTP.Modules.IO; | ||
using GenHTTP.Modules.Layouting; | ||
using GenHTTP.Modules.Markdown; | ||
using GenHTTP.Modules.Websites; | ||
|
||
using GenHTTP.Themes.AdminLTE; | ||
|
||
using $safeprojectname$.Controllers; | ||
|
||
namespace $safeprojectname$ | ||
{ | ||
|
||
public static class Project | ||
{ | ||
|
||
public static IHandlerBuilder Create() | ||
{ | ||
var index = ModMarkdown.Page(Resource.FromAssembly("Home.md")) | ||
.Title("Home"); | ||
|
||
var resources = Resources.From(ResourceTree.FromAssembly("Static")); | ||
|
||
var app = Layout.Create() | ||
.AddController<BookController>("books") | ||
.Index(index) | ||
.Add("static", resources); | ||
|
||
var theme = Theme.Create() | ||
.Title("Book Manager"); | ||
|
||
var menu = Menu.Empty() | ||
.Add("{website}", "Home") | ||
.Add("/books/", "Books"); | ||
|
||
var website = Website.Create() | ||
.Theme(theme) | ||
.Menu(menu) | ||
.Content(app) | ||
.AddScript("custom.js", Resource.FromAssembly("custom.js")) | ||
.AddStyle("custom.css", Resource.FromAssembly("custom.css")); | ||
|
||
return website; | ||
} | ||
|
||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
Templates/Website-MVC-Scriban/$safeprojectname$.Tests/$safeprojectname$.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
|
||
<TargetFramework>net8.0</TargetFramework> | ||
|
||
<LangVersion>10.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
|
||
<IsPackable>false</IsPackable> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
|
||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
|
||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" /> | ||
|
||
<PackageReference Include="GenHTTP.Testing" Version="8.1.0" /> | ||
|
||
<ProjectReference Include="..\$safeprojectname$\$safeprojectname$.csproj" /> | ||
|
||
</ItemGroup> | ||
|
||
</Project> |
27 changes: 27 additions & 0 deletions
27
Templates/Website-MVC-Scriban/$safeprojectname$.Tests/BookControllerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
using GenHTTP.Testing; | ||
|
||
namespace $safeprojectname$.Tests | ||
{ | ||
|
||
[TestClass] | ||
public class BookControllerTests | ||
{ | ||
|
||
[TestMethod] | ||
public async Task TestCanFetchBooks() | ||
{ | ||
using var runner = TestHost.Run(Project.Create()); | ||
|
||
using var response = await runner.GetResponseAsync("/books/"); | ||
|
||
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 2 additions & 33 deletions
35
Templates/Website-MVC-Scriban/$safeprojectname$/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
Templates/Website-MVC-Scriban/$safeprojectname$/Project.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using GenHTTP.Api.Content; | ||
|
||
using GenHTTP.Modules.Controllers; | ||
using GenHTTP.Modules.IO; | ||
using GenHTTP.Modules.Layouting; | ||
using GenHTTP.Modules.Markdown; | ||
using GenHTTP.Modules.Websites; | ||
|
||
using GenHTTP.Themes.AdminLTE; | ||
|
||
using $safeprojectname$.Controllers; | ||
|
||
namespace $safeprojectname$ | ||
{ | ||
|
||
public static class Project | ||
{ | ||
|
||
public static IHandlerBuilder Create() | ||
{ | ||
var index = ModMarkdown.Page(Resource.FromAssembly("Home.md")) | ||
.Title("Home"); | ||
|
||
var resources = Resources.From(ResourceTree.FromAssembly("Static")); | ||
|
||
var app = Layout.Create() | ||
.AddController<BookController>("books") | ||
.Index(index) | ||
.Add("static", resources); | ||
|
||
var theme = Theme.Create() | ||
.Title("Book Manager"); | ||
|
||
var menu = Menu.Empty() | ||
.Add("{website}", "Home") | ||
.Add("/books/", "Books"); | ||
|
||
var website = Website.Create() | ||
.Theme(theme) | ||
.Menu(menu) | ||
.Content(app) | ||
.AddScript("custom.js", Resource.FromAssembly("custom.js")) | ||
.AddStyle("custom.css", Resource.FromAssembly("custom.css")); | ||
|
||
return website; | ||
} | ||
|
||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
Templates/Website-Static/$safeprojectname$.Tests/$safeprojectname$.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
|
||
<TargetFramework>net8.0</TargetFramework> | ||
|
||
<LangVersion>10.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
|
||
<IsPackable>false</IsPackable> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
|
||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
|
||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" /> | ||
|
||
<PackageReference Include="GenHTTP.Testing" Version="8.1.0" /> | ||
|
||
<ProjectReference Include="..\$safeprojectname$\$safeprojectname$.csproj" /> | ||
|
||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.