public void FailCallback(CoapClient.FailReason failReason) { switch (failReason) { case CoapClient.FailReason.Rejected: _taskCompletionSource.SetException(new TradfriException("The gateway rejected the request.")); break; case CoapClient.FailReason.TimedOut: _taskCompletionSource.SetException(new TradfriException("Timed-out waiting for the gateway.")); break; default: _taskCompletionSource.SetException(new TradfriException("Gateway communication error: " + (int)failReason)); break; } }
private void Fail(CoapClient.FailReason reason) { _failed = true; Assert.Fail(); }