Browse Source

Fix tests

pull/240/head
Ionite 1 year ago
parent
commit
7d980c08ab
No known key found for this signature in database
  1. 13
      StabilityMatrix.Tests/Avalonia/FileNameFormatProviderTests.cs

13
StabilityMatrix.Tests/Avalonia/FileNameFormatProviderTests.cs

@ -1,4 +1,5 @@
using StabilityMatrix.Avalonia.Models.Inference;
using System.ComponentModel.DataAnnotations;
using StabilityMatrix.Avalonia.Models.Inference;
namespace StabilityMatrix.Tests.Avalonia;
@ -10,7 +11,8 @@ public class FileNameFormatProviderTests
{
var provider = new FileNameFormatProvider();
provider.Validate("{date}_{time}-{model_name}-{seed}");
var result = provider.Validate("{date}_{time}-{model_name}-{seed}");
Assert.AreEqual(ValidationResult.Success, result);
}
[TestMethod]
@ -18,8 +20,9 @@ public class FileNameFormatProviderTests
{
var provider = new FileNameFormatProvider();
Assert.ThrowsException<ArgumentException>(
() => provider.Validate("{date}_{time}-{model_name}-{seed}-{invalid}")
);
var result = provider.Validate("{date}_{time}-{model_name}-{seed}-{invalid}");
Assert.AreNotEqual(ValidationResult.Success, result);
Assert.AreEqual("Unknown variable 'invalid'", result.ErrorMessage);
}
}

Loading…
Cancel
Save