-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
ce709b2
commit b509a54
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
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,31 @@ | ||
using System.Net; | ||
using GenHTTP.Modules.IO; | ||
using GenHTTP.Modules.Layouting; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace GenHTTP.Testing.Acceptance.Modules.Layouting; | ||
|
||
[TestClass] | ||
public class SectionTests | ||
{ | ||
|
||
[TestMethod] | ||
[MultiEngineTest] | ||
public async Task TestSection(TestEngine engine) | ||
{ | ||
var app = Layout.Create(); | ||
|
||
var section = app.AddSection("section"); | ||
|
||
section.Index(Content.From(Resource.FromString("Hello World"))); | ||
|
||
await using var host = await TestHost.RunAsync(app, engine: engine); | ||
|
||
using var response = await host.GetResponseAsync("/section/"); | ||
|
||
await response.AssertStatusAsync(HttpStatusCode.OK); | ||
|
||
Assert.AreEqual("Hello World", await response.GetContentAsync()); | ||
} | ||
|
||
} |