Beispiel #1
0
        public void Subscribe()
        {
            var test = new MonoBehaviourTest <CreatedConnectionHandlerTest>();

            Assert.That(m_provider.Subscribe(test.component), Is.True);

            // return false if it is already registered.
            Assert.That(m_provider.Subscribe(test.component), Is.False);

            Assert.That(m_provider.Unsubscribe(test.component), Is.True);

            // return false if it is not found.
            Assert.That(m_provider.Unsubscribe(test.component), Is.False);
        }
Beispiel #2
0
        public static TestContainer <T> Create(string name)
        {
            var test         = new MonoBehaviourTest <T>();
            var dependencies = CreateDependencies(test.component);
            var instance     = new RenderStreamingInternal(ref dependencies);
            var provider     = new SignalingEventProvider(instance);
            var container    = new TestContainer <T> {
                test = test, instance = instance, provider = provider
            };

            test.component.SetHandler(instance);
            test.gameObject.name = name;
            provider.Subscribe(test.component);
            return(container);
        }