Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
874 B

1 year ago
using System.ComponentModel.DataAnnotations;
using StabilityMatrix.Avalonia.Models.Inference;
namespace StabilityMatrix.Tests.Avalonia;
[TestClass]
public class FileNameFormatProviderTests
{
[TestMethod]
public void TestFileNameFormatProviderValidate_Valid_ShouldNotThrow()
{
var provider = new FileNameFormatProvider();
1 year ago
var result = provider.Validate("{date}_{time}-{model_name}-{seed}");
Assert.AreEqual(ValidationResult.Success, result);
}
[TestMethod]
public void TestFileNameFormatProviderValidate_Invalid_ShouldThrow()
{
var provider = new FileNameFormatProvider();
1 year ago
var result = provider.Validate("{date}_{time}-{model_name}-{seed}-{invalid}");
Assert.AreNotEqual(ValidationResult.Success, result);
Assert.AreEqual("Unknown variable 'invalid'", result.ErrorMessage);
}
}