您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

27 行
1.0 KiB

using LobbyRelaySample.Auth;
using NUnit.Framework;
namespace Test
{
public class AuthTests
{
/// <summary>
/// Ensure that any changes to a flavor of SubIdentity are automatically updated.
/// </summary>
[Test]
public void IdentityBasicSubidentity()
{
string value = null;
int count = 0;
SubIdentity testIdentity = new SubIdentity();
testIdentity.onChanged += (si) => { value = si.GetContent("key1"); count++; };
testIdentity.SetContent("key1", "newValue1");
Assert.AreEqual(1, count, "Content changed once.");
Assert.AreEqual("newValue1", value, "Should not have to do anything to receive updated content from a set.");
testIdentity.SetContent("key2", "newValue2");
Assert.AreEqual(2, count, "Content changed twice.");
Assert.AreEqual("newValue1", value, "Contents should not affect different keys.");
}
}
}