REORG
This commit is contained in:
parent
f0792a844f
commit
8c8ab70d38
82 changed files with 113 additions and 94 deletions
31
src/test/Yavsc.Tests.Shared/BlogHelpers.cs
Normal file
31
src/test/Yavsc.Tests.Shared/BlogHelpers.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
namespace Yavsc.Blogs.Tests.Fixtures;
|
||||
using static Yavsc.Constants;
|
||||
|
||||
public static class BlogHelpers
|
||||
{
|
||||
public static string ApiUrl(this IBackendFixture fixture, string apiSubPath)
|
||||
{
|
||||
var secured = fixture.Addresses.FirstOrDefault(a => a.StartsWith("https://"));
|
||||
if (secured is null)
|
||||
{
|
||||
var unsecured = fixture.Addresses.FirstOrDefault(a => a.StartsWith("http://"));
|
||||
if (unsecured is null)
|
||||
{
|
||||
throw new InvalidOperationException("No backend address found");
|
||||
}
|
||||
return $"{unsecured}/{APIPrefix}/{apiSubPath}";
|
||||
}
|
||||
return $"{secured}/{APIPrefix}/{apiSubPath}";
|
||||
}
|
||||
|
||||
public static string BlogAclUrl(this IBackendFixture fixture)
|
||||
=> fixture.ApiUrl(BlogAclPath);
|
||||
|
||||
public static string BlogSpotUrl(this IBackendFixture fixture)
|
||||
=> fixture.ApiUrl(BlogSpotPath);
|
||||
|
||||
public static string PublishUrl(this IBackendFixture fixture, long id)
|
||||
=> fixture.ApiUrl(BlogSpotPath) +"/" + id + "/publish";
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue