refacto + test fixes
This commit is contained in:
parent
834df97451
commit
7edb2d7915
8 changed files with 60 additions and 32 deletions
11
src/Yavsc.Blogs.Tests/Fixtures/BlogHelpers.cs
Normal file
11
src/Yavsc.Blogs.Tests/Fixtures/BlogHelpers.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace Yavsc.Blogs.Tests.Fixtures;
|
||||
|
||||
|
||||
public static class BlogHelpers
|
||||
{
|
||||
public static string BlogUrl(this IBackendFixture fixture)
|
||||
=> $"{fixture.Addresses.First(a => a.StartsWith("https://"))}/{Constants.APIPrefix}/{Constants.BlogSpotPath}";
|
||||
|
||||
public static string BlogAclUrl(this IBackendFixture fixture)
|
||||
=> $"{fixture.Addresses.First(a => a.StartsWith("https://"))}/{Constants.APIPrefix}/{Constants.BlogAclPath}";
|
||||
}
|
||||
15
src/Yavsc.Blogs.Tests/Fixtures/IBackendFixture.cs
Normal file
15
src/Yavsc.Blogs.Tests/Fixtures/IBackendFixture.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
using Yavsc.Blogs.Tests;
|
||||
|
||||
public interface IBackendFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// The addresses the fixture bound to.
|
||||
/// </summary>
|
||||
IReadOnlyList<string> Addresses { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The service provider for the fixture host.
|
||||
/// </summary>
|
||||
IServiceProvider Services { get; }
|
||||
}
|
||||
Loading…
Reference in a new issue