예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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" }));
        }