示例#1
0
        public void OnConnect()
        {
            bool   startRaised1  = false;
            string connectionId1 = null;

            signaling1.Start();
            signaling1.OnStart += s => { startRaised1 = true; };
            Assert.True(Wait(() => startRaised1));

            signaling1.OnCreateConnection += (s, connectionId) => { connectionId1 = connectionId; };
            signaling1.CreateConnection();
            Assert.True(Wait(() => !string.IsNullOrEmpty(connectionId1)));
            Assert.IsNotEmpty(connectionId1);
        }
        public IEnumerator OnConnect()
        {
            bool   startRaised1  = false;
            string connectionId1 = null;

            signaling1.OnStart += s => { startRaised1 = true; };
            signaling1.Start();
            yield return(new WaitUntil(() => startRaised1));

            signaling1.OnCreateConnection += (s, connectionId) => { connectionId1 = connectionId; };
            signaling1.CreateConnection();
            yield return(new WaitUntil(() => !string.IsNullOrEmpty(connectionId1)));

            Assert.IsNotEmpty(connectionId1);
        }