public void RegistrationListUnregisterReturnsStatusChange() { var registrationList = new XRInteractionManager.RegistrationList <string>(); Assert.That(registrationList.Unregister("A"), Is.False); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.Register("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.Unregister("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.False); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.Unregister("A"), Is.False); Assert.That(registrationList.Register("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.True); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.Unregister("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.Register("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.Unregister("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.False); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.False); }
public void RegistrationListFastPathMatches() { var registrationList = new XRInteractionManager.RegistrationList <string>(); Assert.That(registrationList.Register("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.True); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.IsStillRegistered("A"), Is.True); Assert.That(registrationList.Unregister("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.IsStillRegistered("A"), Is.False); }
public void RegistrationListSnapshotUnaffectedUntilFlush() { var registrationList = new XRInteractionManager.RegistrationList <string>(); Assert.That(registrationList.Register("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.registeredSnapshot, Is.Empty); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.True); Assert.That(registrationList.registeredSnapshot, Is.EqualTo(new[] { "A" })); Assert.That(registrationList.Unregister("A"), Is.True); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.Register("B"), Is.True); Assert.That(registrationList.IsRegistered("B"), Is.True); Assert.That(registrationList.registeredSnapshot, Is.EqualTo(new[] { "A" })); registrationList.Flush(); Assert.That(registrationList.IsRegistered("A"), Is.False); Assert.That(registrationList.IsRegistered("B"), Is.True); Assert.That(registrationList.registeredSnapshot, Is.EqualTo(new[] { "B" })); }