af1152b001
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
// <copyright file="SystemControllerTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Api.Tests.Controllers
|
|
{
|
|
using Jellyfin.Api.Controllers;
|
|
using Jellyfin.Server.Implementations.SystemBackupService;
|
|
using MediaBrowser.Common.Net;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Model.IO;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Logging;
|
|
using Moq;
|
|
using Xunit;
|
|
|
|
public class SystemControllerTests
|
|
{
|
|
[Fact]
|
|
public void GetLogFile_FileDoesNotExist_ReturnsNotFound()
|
|
{
|
|
var mockFileSystem = new Mock<IFileSystem>();
|
|
mockFileSystem
|
|
.Setup(fs => fs.GetFiles(It.IsAny<string>(), It.IsAny<bool>()))
|
|
.Returns([new() { Name = "file1.txt" }, new() { Name = "file2.txt" }]);
|
|
|
|
var controller = new SystemController(
|
|
Mock.Of<ILogger<SystemController>>(),
|
|
Mock.Of<IServerApplicationHost>(),
|
|
Mock.Of<IServerApplicationPaths>(),
|
|
mockFileSystem.Object,
|
|
Mock.Of<INetworkManager>(),
|
|
Mock.Of<ISystemManager>());
|
|
|
|
var result = controller.GetLogFile("DOES_NOT_EXIST.txt");
|
|
|
|
Assert.IsType<NotFoundObjectResult>(result);
|
|
}
|
|
}
|
|
}
|