Skip to content

Commit

Permalink
fix: test files
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanho committed Mar 21, 2024
1 parent d354dde commit 85100fc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Postal.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Postal.Tests", "src\Postal.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Postal.AspNetCore", "src\Postal.AspNetCore\Postal.AspNetCore.csproj", "{95EE9CE4-5C7E-4D69-99C2-CB131C8CE83E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Postal.Tests.Integration", "test\Postal.Tests.Integration\Postal.Tests.Integration.csproj", "{6DCE1967-27EC-45B0-AB2E-46315C9DE5E6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Postal.Tests.Integration", "test\Postal.Tests.Integration\Postal.Tests.Integration.csproj", "{6DCE1967-27EC-45B0-AB2E-46315C9DE5E6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FCDB5EF4-20BB-4577-B9DC-7C0F879B0BB9}"
ProjectSection(SolutionItems) = preProject
Expand Down
4 changes: 3 additions & 1 deletion src/Postal.AspNetCore/Email.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ protected Email()
{
}

public Email(string viewName, IModelMetadataProvider modelMetadataProvider): this()
public Email(string viewName, IModelMetadataProvider modelMetadataProvider) : this()
{
if (viewName == null) throw new ArgumentNullException(nameof(viewName));
if (string.IsNullOrWhiteSpace(viewName)) throw new ArgumentException("View name cannot be empty.", "viewName");

ViewName = viewName;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public class CustomWebApplicationFactory<TProgram>
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
//builder.UseContentRoot(AppContext.BaseDirectory);
//builder.UseSolutionRelativeContentRoot()
builder.UseSolutionRelativeContentRoot("test/Postal.Tests.Integration");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task Get_EmailTemplateWith_UrlHelper2()
var content = await response.Content.ReadAsStringAsync();

Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Contains("http://localhost:7060/Second/Dummy", content);
Assert.Contains("http://localhost:7060/Privacy", content);
}
}

2 changes: 1 addition & 1 deletion test/Postal.Tests.Integration/Pages/Emails/Testing2.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Subject: Email testing1 subject
@Url.PageLink("/Preview2")
</code>
<br />
<a asp-page="/Preview2" asp-protocol="@this.Context.Request.Scheme">This is generated by Anchor Tag Helper</a>
<a asp-page="/Privacy" asp-protocol="@this.Context.Request.Scheme">This is generated by Anchor Tag Helper</a>
<footer>
</footer>
</body>
Expand Down

0 comments on commit 85100fc

Please sign in to comment.