1fc7792cd1
Rename ConfigManager to ConfigManager.Ui to match the Core/CLI/UI project structure, and split the monolithic test project into Core.Tests, Cli.Tests, and Ui.Tests to align with the source project organization.
41 lines
867 B
C#
41 lines
867 B
C#
using JdeScoping.ConfigManager.Core.Services;
|
|
|
|
namespace JdeScoping.ConfigManager.Core.Tests.Services;
|
|
|
|
public class FileSystemTests
|
|
{
|
|
[Fact]
|
|
public void FileExists_WithExistingFile_ReturnsTrue()
|
|
{
|
|
// Arrange
|
|
var sut = new FileSystem();
|
|
var tempFile = Path.GetTempFileName();
|
|
|
|
try
|
|
{
|
|
// Act
|
|
var result = sut.FileExists(tempFile);
|
|
|
|
// Assert
|
|
result.ShouldBeTrue();
|
|
}
|
|
finally
|
|
{
|
|
File.Delete(tempFile);
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void FileExists_WithNonExistingFile_ReturnsFalse()
|
|
{
|
|
// Arrange
|
|
var sut = new FileSystem();
|
|
|
|
// Act
|
|
var result = sut.FileExists("/nonexistent/path/file.txt");
|
|
|
|
// Assert
|
|
result.ShouldBeFalse();
|
|
}
|
|
}
|