soundvision/UnityProject/Assets/Editor/UnitTest/UnitTest_ParameterResponder.cs
Chikashi Miyama 78023946cd close #28
2019-09-28 20:17:39 +02:00

35 lines
No EOL
750 B
C#

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;
}
}
}