Beispiel #1
0
        public void SetTestSuccess()
        {
            JValue  stateValue = new JValue(12);
            JObject message    = peer.Set(TestSetConnection.successPath, stateValue, this.SetResponseCallback, 3000, 0.0);

            Assert.True(this.setCallbackCalled, "SetCallback was not called");
            Assert.True(this.setSucceeded, "SetCallback was completed successfully");
        }
        public void SetTestOnOwnState()
        {
            peer = new JetPeer(new TestSetCallbackConnection());
            JValue  stateValue = new JValue(12);
            JObject message    = peer.AddState(TestSetCallbackConnection.successPath, stateValue, this.OnSet, this.AddResponseCallback, 3000);

            Assert.Throws <ArgumentException>(
                delegate
            {
                JValue newValue = new JValue(13);
                peer.Set(TestSetCallbackConnection.successPath, newValue, this.AddResponseCallback, 3000, 0.0);
            },
                "no exception thrown when setting own state");
        }