Files
jdescopingtool/NEW/tests/JdeScoping.ConfigManager.Tests/Services/FileSystemTests.cs
T
Joseph Doherty c055bc6c78 feat(configmanager): add IFileSystem abstraction
Add file system abstraction to enable testability for file operations.
- IFileSystem interface with common file operations
- FileSystem implementation wrapping System.IO
- Unit tests for FileExists functionality
2026-01-19 17:33:39 -05:00

41 lines
857 B
C#

using JdeScoping.ConfigManager.Services;
namespace JdeScoping.ConfigManager.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();
}
}