diff options
Diffstat (limited to 'tests/Jellyfin.Api.Tests')
12 files changed, 18 insertions, 507 deletions
diff --git a/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs b/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs index ee20cc573..de03aa5f5 100644 --- a/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs +++ b/tests/Jellyfin.Api.Tests/Auth/CustomAuthenticationHandlerTests.cs @@ -128,6 +128,8 @@ namespace Jellyfin.Api.Tests.Auth { var authorizationInfo = _fixture.Create<AuthorizationInfo>(); authorizationInfo.User = _fixture.Create<User>(); + authorizationInfo.User.AddDefaultPermissions(); + authorizationInfo.User.AddDefaultPreferences(); authorizationInfo.User.SetPermission(PermissionKind.IsAdministrator, isAdmin); authorizationInfo.IsApiKey = false; diff --git a/tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs b/tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs index 09ffa8468..5b3d784ff 100644 --- a/tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs +++ b/tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Net; using System.Threading.Tasks; using AutoFixture; using AutoFixture.AutoMoq; @@ -41,7 +42,7 @@ namespace Jellyfin.Api.Tests.Auth.LocalAccessPolicy public async Task LocalAccessOnly(bool isInLocalNetwork, bool shouldSucceed) { _networkManagerMock - .Setup(n => n.IsInLocalNetwork(It.IsAny<string>())) + .Setup(n => n.IsInLocalNetwork(It.IsAny<IPAddress>())) .Returns(isInLocalNetwork); TestHelpers.SetupConfigurationManager(_configurationManagerMock, true); diff --git a/tests/Jellyfin.Api.Tests/Controllers/BrandingControllerTests.cs b/tests/Jellyfin.Api.Tests/Controllers/BrandingControllerTests.cs deleted file mode 100644 index 40933562d..000000000 --- a/tests/Jellyfin.Api.Tests/Controllers/BrandingControllerTests.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Net.Mime; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; -using MediaBrowser.Model.Branding; -using Xunit; - -namespace Jellyfin.Api.Tests -{ - public sealed class BrandingControllerTests : IClassFixture<JellyfinApplicationFactory> - { - private readonly JellyfinApplicationFactory _factory; - - public BrandingControllerTests(JellyfinApplicationFactory factory) - { - _factory = factory; - } - - [Fact] - public async Task GetConfiguration_ReturnsCorrectResponse() - { - // Arrange - var client = _factory.CreateClient(); - - // Act - var response = await client.GetAsync("/Branding/Configuration"); - - // Assert - Assert.True(response.IsSuccessStatusCode); - Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType); - Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet); - var responseBody = await response.Content.ReadAsStreamAsync(); - _ = await JsonSerializer.DeserializeAsync<BrandingOptions>(responseBody); - } - - [Theory] - [InlineData("/Branding/Css")] - [InlineData("/Branding/Css.css")] - public async Task GetCss_ReturnsCorrectResponse(string url) - { - // Arrange - var client = _factory.CreateClient(); - - // Act - var response = await client.GetAsync(url); - - // Assert - Assert.True(response.IsSuccessStatusCode); - Assert.Equal("text/css", response.Content.Headers.ContentType?.MediaType); - Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet); - } - } -} diff --git a/tests/Jellyfin.Api.Tests/Controllers/DashboardControllerTests.cs b/tests/Jellyfin.Api.Tests/Controllers/DashboardControllerTests.cs deleted file mode 100644 index 300b2697f..000000000 --- a/tests/Jellyfin.Api.Tests/Controllers/DashboardControllerTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.IO; -using System.Net; -using System.Net.Mime; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; -using Jellyfin.Api.Models; -using MediaBrowser.Common.Json; -using Xunit; - -namespace Jellyfin.Api.Tests.Controllers -{ - public sealed class DashboardControllerTests : IClassFixture<JellyfinApplicationFactory> - { - private readonly JellyfinApplicationFactory _factory; - private readonly JsonSerializerOptions _jsonOpions = JsonDefaults.GetOptions(); - - public DashboardControllerTests(JellyfinApplicationFactory factory) - { - _factory = factory; - } - - [Fact] - public async Task GetDashboardConfigurationPage_NonExistingPage_NotFound() - { - var client = _factory.CreateClient(); - - var response = await client.GetAsync("web/ConfigurationPage?name=ThisPageDoesntExists").ConfigureAwait(false); - - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); - } - - [Fact] - public async Task GetDashboardConfigurationPage_ExistingPage_CorrectPage() - { - var client = _factory.CreateClient(); - - var response = await client.GetAsync("/web/ConfigurationPage?name=TestPlugin").ConfigureAwait(false); - - Assert.True(response.IsSuccessStatusCode); - Assert.Equal(MediaTypeNames.Text.Html, response.Content.Headers.ContentType?.MediaType); - StreamReader reader = new StreamReader(typeof(TestPlugin).Assembly.GetManifestResourceStream("Jellyfin.Api.Tests.TestPage.html")!); - Assert.Equal(await response.Content.ReadAsStringAsync(), reader.ReadToEnd()); - } - - [Fact] - public async Task GetDashboardConfigurationPage_BrokenPage_NotFound() - { - var client = _factory.CreateClient(); - - var response = await client.GetAsync("/web/ConfigurationPage?name=BrokenPage").ConfigureAwait(false); - - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); - } - - [Fact] - public async Task GetConfigurationPages_NoParams_AllConfigurationPages() - { - var client = _factory.CreateClient(); - - var response = await client.GetAsync("/web/ConfigurationPages").ConfigureAwait(false); - - Assert.True(response.IsSuccessStatusCode); - - var res = await response.Content.ReadAsStreamAsync(); - _ = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions); - // TODO: check content - } - - [Fact] - public async Task GetConfigurationPages_True_MainMenuConfigurationPages() - { - var client = _factory.CreateClient(); - - var response = await client.GetAsync("/web/ConfigurationPages?enableInMainMenu=true").ConfigureAwait(false); - - Assert.True(response.IsSuccessStatusCode); - Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType); - Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet); - - var res = await response.Content.ReadAsStreamAsync(); - var data = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions); - Assert.Empty(data); - } - } -} diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj index 873ff0ab4..050d4c040 100644 --- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj +++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj @@ -10,15 +10,17 @@ <IsPackable>false</IsPackable> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <Nullable>enable</Nullable> + <AnalysisMode>AllEnabledByDefault</AnalysisMode> + <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> </PropertyGroup> <ItemGroup> - <PackageReference Include="AutoFixture" Version="4.15.0" /> - <PackageReference Include="AutoFixture.AutoMoq" Version="4.15.0" /> - <PackageReference Include="AutoFixture.Xunit2" Version="4.15.0" /> - <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.3" /> + <PackageReference Include="AutoFixture" Version="4.16.0" /> + <PackageReference Include="AutoFixture.AutoMoq" Version="4.16.0" /> + <PackageReference Include="AutoFixture.Xunit2" Version="4.16.0" /> + <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.5" /> <PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" /> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> <PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="coverlet.collector" Version="3.0.3" /> @@ -27,22 +29,14 @@ <!-- Code Analyzers --> <ItemGroup Condition=" '$(Configuration)' == 'Debug' "> - <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\Jellyfin.Server\Jellyfin.Server.csproj" /> - </ItemGroup> - - <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> - <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - - <ItemGroup> - <EmbeddedResource Include="TestPage.html" /> + <ProjectReference Include="../../Jellyfin.Api/Jellyfin.Api.csproj" /> + <ProjectReference Include="../../Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj" /> </ItemGroup> </Project> diff --git a/tests/Jellyfin.Api.Tests/JellyfinApplicationFactory.cs b/tests/Jellyfin.Api.Tests/JellyfinApplicationFactory.cs deleted file mode 100644 index dbbd5ac28..000000000 --- a/tests/Jellyfin.Api.Tests/JellyfinApplicationFactory.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.IO; -using Emby.Server.Implementations; -using Emby.Server.Implementations.IO; -using Jellyfin.Server; -using MediaBrowser.Common; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc.Testing; -using Microsoft.AspNetCore.TestHost; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; -using Serilog.Extensions.Logging; - -namespace Jellyfin.Api.Tests -{ - /// <summary> - /// Factory for bootstrapping the Jellyfin application in memory for functional end to end tests. - /// </summary> - public class JellyfinApplicationFactory : WebApplicationFactory<Startup> - { - private static readonly string _testPathRoot = Path.Combine(Path.GetTempPath(), "jellyfin-test-data"); - private static readonly ConcurrentBag<IDisposable> _disposableComponents = new ConcurrentBag<IDisposable>(); - - /// <summary> - /// Initializes a new instance of the <see cref="JellyfinApplicationFactory"/> class. - /// </summary> - public JellyfinApplicationFactory() - { - // Perform static initialization that only needs to happen once per test-run - Log.Logger = new LoggerConfiguration().WriteTo.Console().CreateLogger(); - Program.PerformStaticInitialization(); - } - - /// <inheritdoc/> - protected override IWebHostBuilder CreateWebHostBuilder() - { - return new WebHostBuilder(); - } - - /// <inheritdoc/> - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - // Specify the startup command line options - var commandLineOpts = new StartupOptions - { - NoWebClient = true - }; - - // Use a temporary directory for the application paths - var webHostPathRoot = Path.Combine(_testPathRoot, "test-host-" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); - Directory.CreateDirectory(Path.Combine(webHostPathRoot, "logs")); - Directory.CreateDirectory(Path.Combine(webHostPathRoot, "config")); - Directory.CreateDirectory(Path.Combine(webHostPathRoot, "cache")); - Directory.CreateDirectory(Path.Combine(webHostPathRoot, "jellyfin-web")); - var appPaths = new ServerApplicationPaths( - webHostPathRoot, - Path.Combine(webHostPathRoot, "logs"), - Path.Combine(webHostPathRoot, "config"), - Path.Combine(webHostPathRoot, "cache"), - Path.Combine(webHostPathRoot, "jellyfin-web")); - - // Create the logging config file - // TODO: We shouldn't need to do this since we are only logging to console - Program.InitLoggingConfigFile(appPaths).GetAwaiter().GetResult(); - - // Create a copy of the application configuration to use for startup - var startupConfig = Program.CreateAppConfiguration(commandLineOpts, appPaths); - - ILoggerFactory loggerFactory = new SerilogLoggerFactory(); - var serviceCollection = new ServiceCollection(); - _disposableComponents.Add(loggerFactory); - - // Create the app host and initialize it - var appHost = new TestAppHost( - appPaths, - loggerFactory, - commandLineOpts, - new ManagedFileSystem(loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths), - serviceCollection); - _disposableComponents.Add(appHost); - appHost.Init(); - - // Configure the web host builder - Program.ConfigureWebHostBuilder(builder, appHost, serviceCollection, commandLineOpts, startupConfig, appPaths); - } - - /// <inheritdoc/> - protected override TestServer CreateServer(IWebHostBuilder builder) - { - // Create the test server using the base implementation - var testServer = base.CreateServer(builder); - - // Finish initializing the app host - var appHost = (TestAppHost)testServer.Services.GetRequiredService<IApplicationHost>(); - appHost.ServiceProvider = testServer.Services; - appHost.InitializeServices().GetAwaiter().GetResult(); - appHost.RunStartupTasksAsync().GetAwaiter().GetResult(); - - return testServer; - } - - /// <inheritdoc/> - protected override void Dispose(bool disposing) - { - foreach (var disposable in _disposableComponents) - { - disposable.Dispose(); - } - - _disposableComponents.Clear(); - - base.Dispose(disposing); - } - } -} diff --git a/tests/Jellyfin.Api.Tests/OpenApiSpecTests.cs b/tests/Jellyfin.Api.Tests/OpenApiSpecTests.cs deleted file mode 100644 index 03ab56d1f..000000000 --- a/tests/Jellyfin.Api.Tests/OpenApiSpecTests.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.IO; -using System.Reflection; -using System.Text.Json; -using System.Threading.Tasks; -using MediaBrowser.Model.Branding; -using Xunit; -using Xunit.Abstractions; - -namespace Jellyfin.Api.Tests -{ - public sealed class OpenApiSpecTests : IClassFixture<JellyfinApplicationFactory> - { - private readonly JellyfinApplicationFactory _factory; - private readonly ITestOutputHelper _outputHelper; - - public OpenApiSpecTests(JellyfinApplicationFactory factory, ITestOutputHelper outputHelper) - { - _factory = factory; - _outputHelper = outputHelper; - } - - [Fact] - public async Task GetSpec_ReturnsCorrectResponse() - { - // Arrange - var client = _factory.CreateClient(); - - // Act - var response = await client.GetAsync("/api-docs/openapi.json"); - - // Assert - response.EnsureSuccessStatusCode(); - Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType?.ToString()); - - // Write out for publishing - var responseBody = await response.Content.ReadAsStringAsync(); - string outputPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ".", "openapi.json")); - _outputHelper.WriteLine("Writing OpenAPI Spec JSON to '{0}'.", outputPath); - File.WriteAllText(outputPath, responseBody); - } - } -} diff --git a/tests/Jellyfin.Api.Tests/ParseNetworkTests.cs b/tests/Jellyfin.Api.Tests/ParseNetworkTests.cs deleted file mode 100644 index 3984407ee..000000000 --- a/tests/Jellyfin.Api.Tests/ParseNetworkTests.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Globalization; -using System.Text; -using Jellyfin.Networking.Configuration; -using Jellyfin.Networking.Manager; -using Jellyfin.Server.Extensions; -using MediaBrowser.Common.Configuration; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.Logging.Abstractions; -using Moq; -using Xunit; - -namespace Jellyfin.Api.Tests -{ - public class ParseNetworkTests - { - /// <summary> - /// Order of the result has always got to be hosts, then networks. - /// </summary> - /// <param name="ip4">IP4 enabled.</param> - /// <param name="ip6">IP6 enabled.</param> - /// <param name="hostList">List to parse.</param> - /// <param name="match">What it should match.</param> - [Theory] - // [InlineData(true, true, "192.168.0.0/16,www.yahoo.co.uk", "::ffff:212.82.100.150,::ffff:192.168.0.0/16")] <- fails on Max. www.yahoo.co.uk resolves to a different ip address. - // [InlineData(true, false, "192.168.0.0/16,www.yahoo.co.uk", "212.82.100.150,192.168.0.0/16")] - [InlineData(true, true, "192.168.t,127.0.0.1,1234.1232.12.1234", "::ffff:127.0.0.1")] - [InlineData(true, false, "192.168.x,127.0.0.1,1234.1232.12.1234", "127.0.0.1")] - [InlineData(true, true, "::1", "::1/128")] - public void TestNetworks(bool ip4, bool ip6, string hostList, string match) - { - using var nm = CreateNetworkManager(); - - var settings = new NetworkConfiguration - { - EnableIPV4 = ip4, - EnableIPV6 = ip6 - }; - - var result = match + ","; - ForwardedHeadersOptions options = new ForwardedHeadersOptions(); - - // Need this here as ::1 and 127.0.0.1 are in them by default. - options.KnownProxies.Clear(); - options.KnownNetworks.Clear(); - - ApiServiceCollectionExtensions.AddProxyAddresses(settings, hostList.Split(','), options); - - var sb = new StringBuilder(); - foreach (var item in options.KnownProxies) - { - sb.Append(item) - .Append(','); - } - - foreach (var item in options.KnownNetworks) - { - sb.Append(item.Prefix) - .Append('/') - .Append(item.PrefixLength.ToString(CultureInfo.InvariantCulture)) - .Append(','); - } - - Assert.Equal(sb.ToString(), result); - } - - private static IConfigurationManager GetMockConfig(NetworkConfiguration conf) - { - var configManager = new Mock<IConfigurationManager> - { - CallBase = true - }; - configManager.Setup(x => x.GetConfiguration(It.IsAny<string>())).Returns(conf); - return configManager.Object; - } - - private static NetworkManager CreateNetworkManager() - { - var conf = new NetworkConfiguration() - { - EnableIPV6 = true, - EnableIPV4 = true, - }; - - return new NetworkManager(GetMockConfig(conf), new NullLogger<NetworkManager>()); - } - } -} diff --git a/tests/Jellyfin.Api.Tests/TestAppHost.cs b/tests/Jellyfin.Api.Tests/TestAppHost.cs deleted file mode 100644 index 772e98d04..000000000 --- a/tests/Jellyfin.Api.Tests/TestAppHost.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.Generic; -using System.Reflection; -using Emby.Server.Implementations; -using Jellyfin.Server; -using MediaBrowser.Controller; -using MediaBrowser.Model.IO; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace Jellyfin.Api.Tests -{ - /// <summary> - /// Implementation of the abstract <see cref="ApplicationHost" /> class. - /// </summary> - public class TestAppHost : CoreAppHost - { - /// <summary> - /// Initializes a new instance of the <see cref="TestAppHost" /> class. - /// </summary> - /// <param name="applicationPaths">The <see cref="ServerApplicationPaths" /> to be used by the <see cref="CoreAppHost" />.</param> - /// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param> - /// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param> - /// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param> - /// <param name="collection">The <see cref="IServiceCollection"/> to be used by the <see cref="CoreAppHost"/>.</param> - public TestAppHost( - IServerApplicationPaths applicationPaths, - ILoggerFactory loggerFactory, - IStartupOptions options, - IFileSystem fileSystem, - IServiceCollection collection) - : base( - applicationPaths, - loggerFactory, - options, - fileSystem, - collection) - { - } - - /// <inheritdoc /> - protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal() - { - foreach (var a in base.GetAssembliesWithPartsInternal()) - { - yield return a; - } - - yield return typeof(TestPlugin).Assembly; - } - } -} diff --git a/tests/Jellyfin.Api.Tests/TestHelpers.cs b/tests/Jellyfin.Api.Tests/TestHelpers.cs index f27cdf7b6..f9bca4146 100644 --- a/tests/Jellyfin.Api.Tests/TestHelpers.cs +++ b/tests/Jellyfin.Api.Tests/TestHelpers.cs @@ -26,8 +26,11 @@ namespace Jellyfin.Api.Tests { var user = new User( "jellyfin", - typeof(DefaultAuthenticationProvider).FullName, - typeof(DefaultPasswordResetProvider).FullName); + typeof(DefaultAuthenticationProvider).FullName!, + typeof(DefaultPasswordResetProvider).FullName!); + + user.AddDefaultPermissions(); + user.AddDefaultPreferences(); // Set administrator flag. user.SetPermission(PermissionKind.IsAdministrator, role.Equals(UserRoles.Administrator, StringComparison.OrdinalIgnoreCase)); diff --git a/tests/Jellyfin.Api.Tests/TestPage.html b/tests/Jellyfin.Api.Tests/TestPage.html deleted file mode 100644 index 8037af8a6..000000000 --- a/tests/Jellyfin.Api.Tests/TestPage.html +++ /dev/null @@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>TestPlugin</title> -</head> -<body> - <h1>This is a Test Page.</h1> -</body> -</html> diff --git a/tests/Jellyfin.Api.Tests/TestPlugin.cs b/tests/Jellyfin.Api.Tests/TestPlugin.cs deleted file mode 100644 index a3b4b6994..000000000 --- a/tests/Jellyfin.Api.Tests/TestPlugin.cs +++ /dev/null @@ -1,43 +0,0 @@ -#pragma warning disable CS1591 - -using System; -using System.Collections.Generic; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Plugins; -using MediaBrowser.Model.Plugins; -using MediaBrowser.Model.Serialization; - -namespace Jellyfin.Api.Tests -{ - public class TestPlugin : BasePlugin<BasePluginConfiguration>, IHasWebPages - { - public TestPlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) - : base(applicationPaths, xmlSerializer) - { - Instance = this; - } - - public static TestPlugin? Instance { get; private set; } - - public override Guid Id => new Guid("2d350a13-0bf7-4b61-859c-d5e601b5facf"); - - public override string Name => nameof(TestPlugin); - - public override string Description => "Server test Plugin."; - - public IEnumerable<PluginPageInfo> GetPages() - { - yield return new PluginPageInfo - { - Name = Name, - EmbeddedResourcePath = GetType().Namespace + ".TestPage.html" - }; - - yield return new PluginPageInfo - { - Name = "BrokenPage", - EmbeddedResourcePath = GetType().Namespace + ".foobar" - }; - } - } -} |
