Added support for cases where the parent directory is included in the request path. Added unit tests to check this case. Bumped package version to 1.6.4

This commit is contained in:
2023-06-29 08:21:54 -07:00
parent 46aab308fa
commit 4617f861fc
3 changed files with 34 additions and 3 deletions

View File

@ -46,6 +46,16 @@ namespace Rest.Net.Tests
resolvedPath.Should().BeEquivalentTo(this.TestFile);
}
[Fact]
public void ServeMultiple_File_WithParentDirectory_ShouldWork()
{
HttpListenerResponseExtensions.ResolveMultiPagePath(this.BaseDirectory, "test/test.html", null, out string resolvedPath, out bool isDirectory).Should().BeTrue();
isDirectory.Should().BeFalse();
resolvedPath.Should().BeEquivalentTo(this.TestFile);
}
[Fact]
public void ServeMultiple_Directory_ShouldWork()
{
@ -88,6 +98,16 @@ namespace Rest.Net.Tests
resolvedPath.Should().BeEquivalentTo(this.TestFile);
}
[Fact]
public void ServeSingle_File_WithParentDirectory_ShouldWork()
{
HttpListenerResponseExtensions.ResolveSinglePagePath(this.BaseDirectory, "test/test.html", null, out string resolvedPath, out bool isDirectory).Should().BeTrue();
isDirectory.Should().BeFalse();
resolvedPath.Should().BeEquivalentTo(this.TestFile);
}
[Fact]
public void ServeSingle_Directory_ShouldWork()
{