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.

45 lines
1.0 KiB

using System.Diagnostics.CodeAnalysis;
using StabilityMatrix.Core.Helper;
1 year ago
namespace StabilityMatrix.Tests.Helper;
[TestClass]
1 year ago
public class EventManagerTests
{
private EventManager eventManager = null!;
1 year ago
[TestInitialize]
public void TestInitialize()
{
eventManager = EventManager.Instance;
}
[TestMethod]
public void GlobalProgressChanged_ShouldBeInvoked()
{
// Arrange
var progress = 0;
eventManager.GlobalProgressChanged += (sender, args) => progress = args;
// Act
eventManager.OnGlobalProgressChanged(100);
// Assert
Assert.AreEqual(100, progress);
}
[TestMethod]
1 year ago
public void RequestPageChange_ShouldBeInvoked()
{
1 year ago
// Arrange
var pageType = typeof(object);
eventManager.PageChangeRequested += (sender, args) => pageType = args;
// Act
eventManager.RequestPageChange(typeof(int));
// Assert
Assert.AreEqual(typeof(int), pageType);
}
}