TestAppHost.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Emby.Server.Implementations;
  4. using Jellyfin.Server;
  5. using MediaBrowser.Controller;
  6. using MediaBrowser.Model.IO;
  7. using Microsoft.Extensions.DependencyInjection;
  8. using Microsoft.Extensions.Logging;
  9. namespace Jellyfin.Api.Tests
  10. {
  11. /// <summary>
  12. /// Implementation of the abstract <see cref="ApplicationHost" /> class.
  13. /// </summary>
  14. public class TestAppHost : CoreAppHost
  15. {
  16. /// <summary>
  17. /// Initializes a new instance of the <see cref="TestAppHost" /> class.
  18. /// </summary>
  19. /// <param name="applicationPaths">The <see cref="ServerApplicationPaths" /> to be used by the <see cref="CoreAppHost" />.</param>
  20. /// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param>
  21. /// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param>
  22. /// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param>
  23. /// <param name="collection">The <see cref="IServiceCollection"/> to be used by the <see cref="CoreAppHost"/>.</param>
  24. public TestAppHost(
  25. IServerApplicationPaths applicationPaths,
  26. ILoggerFactory loggerFactory,
  27. IStartupOptions options,
  28. IFileSystem fileSystem,
  29. IServiceCollection collection)
  30. : base(
  31. applicationPaths,
  32. loggerFactory,
  33. options,
  34. fileSystem,
  35. collection)
  36. {
  37. }
  38. /// <inheritdoc />
  39. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  40. {
  41. foreach (var a in base.GetAssembliesWithPartsInternal())
  42. {
  43. yield return a;
  44. }
  45. yield return typeof(TestPlugin).Assembly;
  46. }
  47. }
  48. }