41 lines
1006 B
C#
Executable File
41 lines
1006 B
C#
Executable File
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using MarketAlly.AIPlugin.Security;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace MarketAlly.AIPlugin.Tests
|
|
{
|
|
[TestClass]
|
|
public class QuickTests
|
|
{
|
|
[TestMethod]
|
|
public void SecurityValidator_WindowsPath_ShouldWork()
|
|
{
|
|
// Arrange
|
|
var tempDir = Path.GetTempPath();
|
|
var config = new SecurityConfiguration
|
|
{
|
|
AllowedDirectories = new List<string> { tempDir }
|
|
};
|
|
var windowsPath = Path.Combine(tempDir, "test.txt");
|
|
|
|
// Act & Assert - Should not throw
|
|
var result = SecurityValidator.ValidateAndNormalizePath(windowsPath, config);
|
|
Assert.IsNotNull(result);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void SecurityValidator_SanitizeInput_NormalContent_ShouldWork()
|
|
{
|
|
// Arrange
|
|
var normalContent = "This is normal file content with spaces and punctuation.";
|
|
|
|
// Act
|
|
var result = SecurityValidator.SanitizeInput(normalContent);
|
|
|
|
// Assert
|
|
Assert.AreEqual(normalContent, result);
|
|
}
|
|
}
|
|
} |