soundvision/UnityProject/Assets/Editor/UnitTest/UnitTest_ParameterResponder.cs

35 lines
750 B
C#
Raw Normal View History

2019-09-28 18:17:39 +00:00
using NUnit.Framework;
namespace cylvester
{
public class UnitTest_ParameterResponder
{
[Test]
public void Set_Get()
{
var responder = new Parameter<float>(1.0f);
responder.Value = 3.2f;
Assert.AreEqual(3.2f, responder.Value);
}
[Test]
public void ValueChanged()
{
var responder = new Parameter<float>(1.0f);
responder.Value = 0f;
void OnValueChanged()
{
Assert.AreEqual(3.2f, responder.Value);
}
responder.ValueChanged += OnValueChanged;
responder.Value = 3.2f;
responder.ValueChanged -= OnValueChanged;
}
}
}