201 references to Assert
System.ServiceModel.Primitives (201)
Internals\System\Runtime\ActionItem.cs (8)
22Fx.Assert(callback != null, "A null callback was passed for Schedule!"); 36Fx.Assert(callback != null, "A null callback was passed for Schedule!"); 76Fx.Assert(callback != null, "Cannot schedule a null callback"); 82Fx.Assert(callback != null, "Cannot schedule a null callback"); 153Fx.Assert(callback != null, "Shouldn't instantiate an object to wrap a null callback"); 173Fx.Assert(callback != null, "Shouldn't instantiate an object to wrap a null callback"); 193Fx.Assert(_asyncCallback == null, "Can't call Invoke on async ActionItem"); 206Fx.Assert(_callback == null, "Can't call InvokeAsync on sync ActionItem");
Internals\System\Runtime\AsyncLock.cs (2)
85Fx.Assert(_nextSemaphore == _asyncLock._currentSemaphore.Value, "_nextSemaphore was expected to by the current semaphore"); 112Fx.Assert(_nextSemaphore == _asyncLock._currentSemaphore.Value, "_nextSemaphore was expected to by the current semaphore");
Internals\System\Runtime\AsyncResult.cs (1)
120Fx.Assert(_manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
Internals\System\Runtime\BufferedOutputStream.cs (7)
98Fx.Assert(!_initialized, "Clear must be called before re-initializing stream"); 213Fx.Assert(_initialized, "No data to return from uninitialized stream"); 214Fx.Assert(!_bufferReturned, "ToArray cannot be called more than once"); 259Fx.Assert(_initialized, "Cannot write to uninitialized stream"); 260Fx.Assert(!_bufferReturned, "Cannot write to stream once ToArray has been called."); 304Fx.Assert(_initialized, "Cannot write to uninitialized stream"); 305Fx.Assert(!_bufferReturned, "Cannot write to stream once ToArray has been called.");
Internals\System\Runtime\CallbackException.cs (2)
18Fx.Assert(innerException != null, "CallbackException requires an inner exception."); 19Fx.Assert(!Fx.IsFatal(innerException), "CallbackException can't be used to wrap fatal exceptions.");
Internals\System\Runtime\Diagnostics\EtwDiagnosticTrace.cs (1)
365Fx.Assert(sb != null, "'sb' MUST NOT be NULL.");
Internals\System\Runtime\ExceptionTrace.cs (4)
24Fx.Assert(diagnosticTrace != null, "'diagnosticTrace' MUST NOT be NULL."); 140Fx.Assert(targetInvocationException != null, "targetInvocationException cannot be null."); 184Fx.Assert(aggregateException != null, "aggregateException cannot be null."); 223Fx.Assert(innerExceptions.Count > 0, "InnerException.Count is known to be > 0 here.");
Internals\System\Runtime\FatalException.cs (1)
19Fx.Assert(innerException == null || !Fx.IsFatal(innerException), "FatalException can't be used to wrap fatal exceptions.");
Internals\System\Runtime\Fx.cs (1)
304Fx.Assert(callback != null, "Trying to create a ThunkCallback with a null callback method");
Internals\System\Runtime\InputQueue.cs (9)
37Fx.Assert(asyncCallbackGenerator != null, "use default ctor if you don't have a generator"); 381Fx.Assert(exception != null, "EnqueueAndDispatch: exception parameter should not be null"); 387Fx.Assert(item != null, "EnqueueAndDispatch: item parameter should not be null"); 393Fx.Assert(item != null, "EnqueueWithoutDispatch: item parameter should not be null"); 399Fx.Assert(exception != null, "EnqueueWithoutDispatch: exception parameter should not be null"); 676Fx.Assert(state != null, "InputQueue.OnInvokeDequeuedCallback: (state != null)"); 805Fx.Assert(reader != null, "InputQueue.RemoveReader: (reader != null)"); 1096Fx.Assert(_item == null, "InputQueue.WaitQueueReader.Set: (this.item == null)"); 1097Fx.Assert(_exception == null, "InputQueue.WaitQueueReader.Set: (this.exception == null)");
Internals\System\Runtime\InternalBufferManager.cs (3)
33Fx.Assert(maxBufferPoolSize > 0 && maxBufferSize >= 0, "bad params, caller should verify"); 212Fx.Assert(buffer != null, "caller must verify"); 232Fx.Assert(bufferSize >= 0, "caller must ensure a non-negative argument");
Internals\System\Runtime\IOThreadScheduler.cs (3)
491Fx.Assert(iots != null, "Overlapped completed without a scheduler."); 522Fx.Assert(_scheduler == null, "Post called on an overlapped that is already posted."); 523Fx.Assert(iots != null, "Post called with a null scheduler.");
Internals\System\Runtime\IOThreadTimer.cs (6)
399Fx.Assert(count > 0, "Should have at least one timer in our queue."); 414Fx.Assert(index > 0, ""); 415Fx.Assert(index <= count, ""); 445Fx.Assert(timer.index == 0, "Timer should not have an index."); 498Fx.Assert(index > 0, ""); 499Fx.Assert(index <= count, "");
Internals\System\Runtime\MruCache.cs (5)
53Fx.Assert(lowWatermark < highWatermark, ""); 54Fx.Assert(lowWatermark >= 0, ""); 82Fx.Assert(null != key, ""); 160Fx.Assert(null != key, ""); 226Fx.Assert(refCount >= 0, "Ref count shouldn't go below zero");
Internals\System\Runtime\TaskHelpers.cs (6)
252Fx.Assert(task.IsCompleted || !IOThreadScheduler.IsRunningOnIOThread, "Waiting on an IO Thread might cause problems"); 266Fx.Assert(!IOThreadScheduler.IsRunningOnIOThread, "Waiting on an IO Thread might cause problems"); 278Fx.Assert(task.IsCompleted || !IOThreadScheduler.IsRunningOnIOThread, "Waiting on an IO Thread might cause problems"); 288Fx.Assert(!IOThreadScheduler.IsRunningOnIOThread, "Waiting on an IO Thread might cause problems"); 308Fx.Assert(!IOThreadScheduler.IsRunningOnIOThread, "Waiting on an IO Thread might cause problems"); 398Fx.Assert(Thread.CurrentThread.IsThreadPoolThread, "We should be running on the thread pool");
Internals\System\Runtime\UrlUtility.cs (1)
370Fx.Assert(n < 0x10, "n < 0x10");
Internals\System\Text\BinHexEncoding.cs (4)
31Fx.Assert(s_char2val[ch] == ch - '0', ""); 36Fx.Assert(s_char2val[ch] == ch - 'A' + 10, ""); 41Fx.Assert(s_char2val[ch] == ch - 'a' + 10, ""); 94Fx.Assert(pch + 2 <= pchMax, "");
Internals\System\Xml\XmlMtomReader.cs (1)
1851Fx.Assert(content != null, "");
System\ServiceModel\ActionMismatchAddressingException.cs (1)
31Fx.Assert(messageVersion.Addressing == AddressingVersion.WSAddressing10, "");
System\ServiceModel\ChannelFactory.cs (2)
172Fx.Assert(State == CommunicationState.Created || State == CommunicationState.Opening, ""); 181Fx.Assert(State == CommunicationState.Created || State == CommunicationState.Opening, "");
System\ServiceModel\ChannelFactoryRefCache.cs (1)
30Fx.Assert(_refCount >= 0, "RefCount should not be less than zero.");
System\ServiceModel\Channels\AddressHeader.cs (3)
346Fx.Assert(reader.NodeType == XmlNodeType.Element, ""); 349Fx.Assert(_name != null, ""); 350Fx.Assert(_ns != null, "");
System\ServiceModel\Channels\Addressing.cs (7)
95Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.Action, addressingVersion.DictionaryNamespace), ""); 227Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.From, addressingVersion.DictionaryNamespace), ""); 321Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.FaultTo, version.DictionaryNamespace), ""); 466Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.To, version.DictionaryNamespace), ""); 662Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.ReplyTo, version.DictionaryNamespace), ""); 741Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.MessageId, version.DictionaryNamespace), ""); 883Fx.Assert(reader.IsStartElement(addressingDictionary.RelatesTo, version.DictionaryNamespace), "");
System\ServiceModel\Channels\BindingElement.cs (1)
51Fx.Assert(true, "Should not be called unless this binding element is used in one of the standard bindings. In which case, please re-implement the IsMatch() method.");
System\ServiceModel\Channels\CommunicationObject.cs (1)
452Fx.Assert(currentState == CommunicationState.Closing || currentState == CommunicationState.Closed || currentState == CommunicationState.Faulted,
System\ServiceModel\Channels\LayeredChannel.cs (1)
19Fx.Assert(innerChannel != null, "innerChannel cannot be null");
System\ServiceModel\Channels\LifetimeManager.cs (2)
212Fx.Assert(State == LifetimeState.Opened, "LifetimeManager.IncrementBusyCount: (this.State == LifetimeState.Opened)"); 219Fx.Assert(State == LifetimeState.Opened, "LifetimeManager.IncrementBusyCountWithoutLock: (this.State == LifetimeState.Opened)");
System\ServiceModel\Channels\Message.cs (1)
881Fx.Assert(message != null, "message should never be null");
System\ServiceModel\Channels\MessageHeader.cs (2)
565Fx.Assert(_name != null, ""); 566Fx.Assert(_ns != null, "");
System\ServiceModel\Channels\MessageHeaders.cs (4)
1326Fx.Assert(reader.IsStartElement(XD.MessageDictionary.Header, envelopeVersion.DictionaryNamespace), ""); 1483Fx.Assert(MessageVersion.Addressing.DictionaryNamespace != null, "non-None Addressing requires a non-null DictionaryNamespace"); 1930Fx.Assert(HeaderType == HeaderType.WriteableHeader || HeaderType == HeaderType.ReadableHeader, ""); 1941Fx.Assert(HeaderType == HeaderType.ReadableHeader, "");
System\ServiceModel\Channels\MethodCall.cs (1)
65Fx.Assert((inPos - 1) != (inCount), $"Incorrect number of arguments put into _inArgs array, expected {inCount} and copied {inPos - 1}");
System\ServiceModel\Channels\ReliableRequestSessionChannel.cs (3)
718Fx.Assert(_tcs?.Task == null || !_tcs.Task.IsCompleted, "Task should be null or not already be completed"); 732Fx.Assert(_tcs?.Task == null || !_tcs.Task.IsCompleted, "Task should be null or not already be completed"); 757Fx.Assert(_tcs?.Task == null || !_tcs.Task.IsCompleted, "Task should be null or not already be completed");
System\ServiceModel\Channels\RequestContextBase.cs (2)
51Fx.Assert(_requestMessageException == null, "Cannot have both a requestMessage and a requestException."); 57Fx.Assert(_requestMessage == null, "Cannot have both a requestMessage and a requestException.");
System\ServiceModel\Channels\RequestReplyCorrelator.cs (1)
66Fx.Assert(request != null, "request cannot be null");
System\ServiceModel\Channels\SecurityChannelFactory.cs (1)
51Fx.Assert(SessionMode == true, "SessionClientSettings can only be used if SessionMode == true");
System\ServiceModel\Channels\ServiceChannel.cs (2)
668Fx.Assert(channel != null, "'channel' MUST NOT be NULL."); 669Fx.Assert(operation != null, "'operation' MUST NOT be NULL.");
System\ServiceModel\Channels\TimeoutStream.cs (4)
59Fx.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable"); 69Fx.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable"); 102Fx.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable"); 112Fx.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable");
System\ServiceModel\ClientBase.cs (6)
631Fx.Assert(_channelFactoryRef == null, "The channelFactory should have never been assigned"); 632Fx.Assert(_canShareFactory, "GetChannelFactoryFromCache can be called only when canShareFactory is true"); 666Fx.Assert(endpointTrait != null, "The endpointTrait should not be null when the factory can be shared."); 726Fx.Assert(_canShareFactory, "This should be called only when this proxy can share ChannelFactory."); 727Fx.Assert(_channelFactoryRef.ChannelFactory.State == CommunicationState.Opened, 943Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length");
System\ServiceModel\Description\DispatcherBuilder.cs (1)
225Fx.Assert(proxyOperation != null, "");
System\ServiceModel\Description\ServiceReflector.cs (1)
211Fx.Assert(null != localName, "");
System\ServiceModel\Description\TypedMessageConverter.cs (1)
105Fx.Assert(message.Headers != null, "");
System\ServiceModel\Description\TypeLoader.cs (7)
158Fx.Assert(contractType != null, ""); 165Fx.Assert(contractType != null, ""); 166Fx.Assert(serviceType != null, ""); 173Fx.Assert(contractType != null, ""); 174Fx.Assert(serviceType != null, ""); 175Fx.Assert(serviceImplementation != null, ""); 674Fx.Assert(NamingHelper.IsValidNCName(operationName), "operationName value has to be a valid NCName.");
System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (4)
49Fx.Assert(reflector != null, ""); 276Fx.Assert(parent != null, ""); 277Fx.Assert(operation != null, ""); 278Fx.Assert(attr != null, "");
System\ServiceModel\Diagnostics\TraceAsyncResult.cs (1)
42Fx.Assert(thisPtr.CallbackActivity != null, "this shouldn't be hooked up if we don't have a CallbackActivity");
System\ServiceModel\Dispatcher\ChannelHandler.cs (2)
104Fx.Assert((_idleManager != null) == (Binder.HasSession && _listener.ChannelDispatcher.DefaultCommunicationTimeouts.ReceiveTimeout != TimeSpan.MaxValue), "idle manager is present only when there is a session with a finite receive timeout"); 151Fx.Assert(bufferedBinder != null, "ChannelHandler.Binder is not a BufferedReceiveBinder");
System\ServiceModel\Dispatcher\ClientRuntime.cs (2)
74Fx.Assert(shared.IsOnServer, "Server constructor called on client?"); 80Fx.Assert(!_shared.IsOnServer, "Client constructor called on server?");
System\ServiceModel\Dispatcher\DispatchRuntime.cs (1)
38Fx.Assert(!shared.IsOnServer, "Client constructor called on server?");
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (13)
32Fx.Assert(channel != null, "caller must verify"); 33Fx.Assert(correlator != null, "caller must verify"); 556Fx.Assert(request != null, "request cannot be null"); 563Fx.Assert(request != null, "request cannot be null"); 753Fx.Assert(_requestCorrelatorKey == null, "RequestCorrelatorKey is already set for this request"); 857Fx.Assert(_requestCorrelatorKey == null, "RequestCorrelatorKey is already set for this request"); 1537Fx.Assert(_backgroundCloseData == null, "can't try twice"); 1551Fx.Assert(_backgroundCloseData != null, "Only callable from background close"); 1570Fx.Assert(_backgroundCloseData != null, "Need to check background close first"); 1572Fx.Assert(dummy == null, "we should get an exception or null"); 1577Fx.Assert(_backgroundCloseData != null, "Need to check background close first"); 1583Fx.Assert(_backgroundCloseData != null, "Need to check background close first"); 1585Fx.Assert(dummy == null, "we should get an exception or null");
System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
209Fx.Assert(serializer != null, "");
System\ServiceModel\Dispatcher\ImmutableDispatchRuntime.cs (1)
762Fx.Assert(
System\ServiceModel\Dispatcher\MessageRpc.cs (2)
65Fx.Assert((operationContext != null), "System.ServiceModel.Dispatcher.MessageRpc.MessageRpc(), operationContext == null"); 66Fx.Assert(channelHandler != null, "System.ServiceModel.Dispatcher.MessageRpc.MessageRpc(), channelHandler == null");
System\ServiceModel\Dispatcher\OperationFormatter.cs (1)
784Fx.Assert(!_onBeginWriteBodyContentsCalled, "OnBeginWriteBodyContents has already been called");
System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (1)
372Fx.Assert(bodyDescription != null, "");
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (4)
78Fx.Assert(invokeTask.Exception != null, "Task.IsFaulted guarantees non-null exception."); 83Fx.Assert(invokeTask.IsCompleted, "Task.Result is expected to be completed"); 86Fx.Assert(task != null, "Returned object is expected to be a non-null Task"); 89Fx.Assert(task.Exception != null, "Task.IsFaulted guarantees non-null exception.");
System\ServiceModel\Dispatcher\ThreadBehavior.cs (2)
94Fx.Assert(instanceContext != null, "instanceContext is null !"); 110Fx.Assert(syncContext != null, "syncContext is null !?");
System\ServiceModel\EndpointAddress.cs (3)
482Fx.Assert(reader.Name == DummyName, "EndpointAddress: Expected dummy element not found"); 1252Fx.Assert(reader.Name == EndpointAddress.DummyName, "EndpointAddressBuilder: Expected dummy element not found"); 1286Fx.Assert(reader.Name == EndpointAddress.DummyName, "EndpointAddressBuilder: Expected dummy element not found");
System\ServiceModel\FaultException.cs (1)
302Fx.Assert(code == null, "FaultException.FaultCodeData.GetObjectData: (code != null)");
System\ServiceModel\ProgrammaticEndpointTrait.cs (6)
54Fx.Assert(_remoteAddress != null, "remoteAddress should not be null."); 58Fx.Assert(_binding != null, "binding should not be null."); 74Fx.Assert(_remoteAddress != null, "remoteAddress should not be null."); 75Fx.Assert(_binding != null, "binding should not be null."); 82Fx.Assert(_remoteAddress != null, "remoteAddress should not be null."); 83Fx.Assert(_binding != null, "binding should not be null.");
System\ServiceModel\Security\IssuanceTokenProviderBase.cs (1)
98Fx.Assert(TimeSpan.Parse(defaultClientMaxTokenCachingTimeString, CultureInfo.InvariantCulture) == TimeSpan.MaxValue, "TimeSpan value not correct");
System\ServiceModel\Security\ReceiveSecurityHeader.cs (5)
322Fx.Assert(ReaderQuotas != null, "Reader quotas must be set before processing"); 630Fx.Assert((position == AppendPosition) == (decryptedBuffer == null), "inconsistent position, decryptedBuffer parameters"); 631Fx.Assert((position == AppendPosition) == (encryptionToken == null), "inconsistent position, encryptionToken parameters"); 813Fx.Assert(header.Name == Name && header.Namespace == Namespace && header.Actor == Actor, "security header index mismatch"); 889Fx.Assert(_enforce, "OrderTracker should have 'enforce' set to true.");
System\ServiceModel\Security\ReceiveSecurityHeaderElementManager.cs (8)
69Fx.Assert(0 <= index && index < Count, ""); 75Fx.Assert(0 <= index && index < Count, "index out of range"); 81Fx.Assert(0 <= index && index < Count, "index out of range"); 87Fx.Assert(0 <= index && index < Count, "index out of range"); 114Fx.Assert(0 <= index && index < Count, "index out of range"); 123Fx.Assert(0 <= index && index < Count, "index out of range"); 124Fx.Assert(_elements[index]._elementCategory == ReceiveSecurityHeaderElementCategory.EncryptedData, "Replaced item must be EncryptedData"); 140Fx.Assert(id != null, "Uniqueness should only be tested for non-empty ids");
System\ServiceModel\Security\SecurityAppliedMessage.cs (1)
34Fx.Assert(!(messageToProcess is SecurityAppliedMessage), "SecurityAppliedMessage should not be wrapped");
System\ServiceModel\Security\SecurityTimestamp.cs (3)
32Fx.Assert(creationTimeUtc.Kind == DateTimeKind.Utc, "creation time must be in UTC"); 33Fx.Assert(expiryTimeUtc.Kind == DateTimeKind.Utc, "expiry time must be in UTC"); 133Fx.Assert(n == 0, "Overflow in encoding timestamp field");
System\ServiceModel\Security\SecurityVerifiedMessage.cs (1)
507Fx.Assert(openCharIndex > 0, "");
System\ServiceModel\Security\TimeBoundedCache.cs (3)
331Fx.Assert(item.ExpirationTime == DateTime.MaxValue || item.ExpirationTime.Kind == DateTimeKind.Utc, ""); 463Fx.Assert(item1.ExpirationTime.Kind == item2.ExpirationTime.Kind, ""); 486Fx.Assert(expirationTime == DateTime.MaxValue || expirationTime.Kind == DateTimeKind.Utc, "");
System\ServiceModel\Security\Tokens\DerivedKeySecurityToken.cs (1)
45Fx.Assert(nonce.Length == minNonceLength, "Returned random bytes for nonce is not the expected length");
System\ServiceModel\Security\WSSecureConversation.cs (1)
412Fx.Assert(reader.NodeType == XmlNodeType.Element, "");
System\ServiceModel\Security\WSSecurityOneDotZeroSendSecurityHeader.cs (2)
164Fx.Assert(canonicalBuffer != null, "Canonical buffer cannot be null."); 208Fx.Assert(canonicalBuffer != null, "Canonical buffer cannot be null.");
System\ServiceModel\Security\X509ServiceCertificateAuthentication.cs (1)
156Fx.Assert(_customCertificateValidator == null, "");
System\ServiceModel\ServiceChannelManager.cs (3)
77Fx.Assert(_activityWaiter == null, "ServiceChannelManager.CloseInput: (_activityWaiter == null)"); 111Fx.Assert(_activityWaiter == null, "ServiceChannelManager.CloseInput: (this.activityWaiter == null)"); 143Fx.Assert(ActivityCount > 0, "ServiceChannelManager.DecrementActivityCount: (this.activityCount > 0)");
System\ServiceModel\ServiceEndpointTrait.cs (3)
46Fx.Assert(_serviceEndpoint != null, "endpoint should not be null."); 62Fx.Assert(_serviceEndpoint != null, "endpoint should not be null."); 68Fx.Assert(_serviceEndpoint != null, "endpoint should not be null.");
System\ServiceModel\XmlBuffer.cs (1)
68Fx.Assert(_bufferState == BufferState.Reading, "Buffer size shuold only be retrieved during Reading state");
System\ServiceModel\XmlUtil.cs (1)
108Fx.Assert(j > i, "Logic error in XmlUtil.Trim().");