100 references to Assert
System.ServiceModel.Internals (100)
System\Runtime\ActionItem.cs (5)
46Fx.Assert(callback != null, "A null callback was passed for Schedule!"); 130Fx.Assert(callback != null, "Cannot schedule a null callback"); 145Fx.Assert(this.context != null, "Cannot bind to a null context; context should have been set by now"); 146Fx.Assert(this.isScheduled, "Context is extracted only while the object is scheduled"); 248Fx.Assert(callback != null, "Shouldn't instantiate an object to wrap a null callback");
System\Runtime\AsyncResult.cs (1)
159Fx.Assert(this.manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
System\Runtime\BufferedOutputStream.cs (7)
99Fx.Assert(!this.initialized, "Clear must be called before re-initializing stream"); 214Fx.Assert(this.initialized, "No data to return from uninitialized stream"); 215Fx.Assert(!this.bufferReturned, "ToArray cannot be called more than once"); 260Fx.Assert(this.initialized, "Cannot write to uninitialized stream"); 261Fx.Assert(!this.bufferReturned, "Cannot write to stream once ToArray has been called."); 305Fx.Assert(this.initialized, "Cannot write to uninitialized stream"); 306Fx.Assert(!this.bufferReturned, "Cannot write to stream once ToArray has been called.");
System\Runtime\CallbackException.cs (2)
21Fx.Assert(innerException != null, "CallbackException requires an inner exception."); 22Fx.Assert(!Fx.IsFatal(innerException), "CallbackException can't be used to wrap fatal exceptions.");
System\Runtime\Collections\HopperCache.cs (6)
63Fx.Assert(hopperSize > 0, "HopperCache hopperSize must be positive."); 76Fx.Assert(key != null, "HopperCache key cannot be null."); 77Fx.Assert(value != null, "HopperCache value cannot be null."); 85Fx.Assert(this.strongHopper.Count <= this.hopperSize * 2, 113Fx.Assert(key != null, "Can't look up a null key."); 176Fx.Assert(this.outstandingHopper.Count <= this.hopperSize,
System\Runtime\Collections\ObjectCache.cs (15)
39Fx.Assert(settings != null, "caller must use a valid settings object"); 75Fx.Assert(key != null, "caller must validate parameters"); 76Fx.Assert(value != null, "caller must validate parameters"); 99Fx.Assert(key != null, "caller must validate parameters"); 118Fx.Assert(createdObject != null, "initializer delegate must always give us a valid object"); 168Fx.Assert(removedFromItems, "we should always find the key"); 203Fx.Assert(!item.Equals(default(T)), "item should never be null"); 407Fx.Assert(this.parent.cacheItems.ContainsValue(this), "should have a valid value"); 408Fx.Assert(this.Value != null, "should have a valid value"); 428Fx.Assert(this.referenceCount == 1, "reference count should have never increased"); 458Fx.Assert(this.referenceCount >= 0, "cannot take the item marked for disposal"); 464Fx.Assert(this.referenceCount > 0, "can only release an item that has references"); 471Fx.Assert(this.referenceCount == 0, "we should only dispose items without references"); 482Fx.Assert(localDisposeItemCallback == null, "shouldn't have both this.disposeItemCallback and this.parent"); 502Fx.Assert(this.referenceCount == -1, "we should only dispose items that have had LockedDispose called on them");
System\Runtime\Collections\ObjectCacheSettings.cs (4)
48Fx.Assert(value >= 0, "caller should validate cache limit is non-negative"); 61Fx.Assert(value >= TimeSpan.Zero, "caller should validate cache limit is non-negative"); 74Fx.Assert(value >= TimeSpan.Zero, "caller should validate cache limit is non-negative"); 87Fx.Assert(value >= 0, "caller should validate purge frequency is non-negative");
System\Runtime\Diagnostics\DiagnosticEventProvider.cs (1)
737Fx.Assert(false, "eventTraceActivity should not be null for WriteTransferEvent");
System\Runtime\Diagnostics\DiagnosticTraceBase.cs (1)
569Fx.Assert(s == type.ToString(), "Return value should equal the name of the enum");
System\Runtime\Diagnostics\EtwDiagnosticTrace.cs (1)
968Fx.Assert(sb != null, "'sb' MUST NOT be NULL.");
System\Runtime\DuplicateDetector.cs (4)
18Fx.Assert(capacity >= 0, "The capacity parameter must be a positive value."); 28Fx.Assert(value != null, "The value must be non null."); 45Fx.Assert(this.items.Count == this.fifoList.Count, "The items and fifoList must be synchronized."); 59Fx.Assert(value != null, "The value must be non null.");
System\Runtime\ExceptionTrace.cs (4)
26Fx.Assert(diagnosticTrace != null, "'diagnosticTrace' MUST NOT be NULL."); 84Fx.Assert(targetInvocationException != null, "targetInvocationException cannot be null."); 128Fx.Assert(aggregateException != null, "aggregateException cannot be null."); 167Fx.Assert(innerExceptions.Count > 0, "InnerException.Count is known to be > 0 here.");
System\Runtime\FatalException.cs (1)
24Fx.Assert(innerException == null || !Fx.IsFatal(innerException), "FatalException can't be used to wrap fatal exceptions.");
System\Runtime\InputQueue.cs (9)
42Fx.Assert(asyncCallbackGenerator != null, "use default ctor if you don't have a generator"); 327Fx.Assert(exception != null, "EnqueueAndDispatch: exception parameter should not be null"); 333Fx.Assert(item != null, "EnqueueAndDispatch: item parameter should not be null"); 339Fx.Assert(item != null, "EnqueueWithoutDispatch: item parameter should not be null"); 345Fx.Assert(exception != null, "EnqueueWithoutDispatch: exception parameter should not be null"); 572Fx.Assert(state != null, "InputQueue.OnInvokeDequeuedCallback: (state != null)"); 701Fx.Assert(reader != null, "InputQueue.RemoveReader: (reader != null)"); 1024Fx.Assert(this.item == null, "InputQueue.WaitQueueReader.Set: (this.item == null)"); 1025Fx.Assert(this.exception == null, "InputQueue.WaitQueueReader.Set: (this.exception == null)");
System\Runtime\InternalBufferManager.cs (3)
36Fx.Assert(maxBufferPoolSize > 0 && maxBufferSize >= 0, "bad params, caller should verify"); 216Fx.Assert(buffer != null, "caller must verify"); 256Fx.Assert(bufferSize >= 0, "caller must ensure a non-negative argument");
System\Runtime\IOThreadCancellationTokenSource.cs (3)
58Fx.Assert(this.timer != null, "timer should not be null."); 69Fx.Assert(obj != null, "obj should not be null."); 76Fx.Assert(this.source != null, "source should not be null.");
System\Runtime\IOThreadScheduler.cs (14)
91Fx.Assert(capacity > 0, "Capacity must be positive."); 92Fx.Assert(capacity <= 0x8000, "Capacity cannot exceed 32k."); 94Fx.Assert(capacityLowPri > 0, "Low-priority capacity must be positive."); 95Fx.Assert(capacityLowPri <= 0x8000, "Low-priority capacity cannot exceed 32k."); 98Fx.Assert((this.slots.Length & SlotMask) == 0, "Capacity must be a power of two."); 101Fx.Assert((this.slotsLowPri.Length & SlotMaskLowPri) == 0, "Low-priority capacity must be a power of two."); 160Fx.Assert(Bits.Count(slot) != 0, "IOTS went idle when it shouldn't have."); 258Fx.Assert(Bits.Count(slot) != -1, "CompletionCallback called on idle IOTS!"); 493Fx.Assert(this.callback == null, "Slot already has a work item."); 494Fx.Assert((gateSnapshot & Bits.HiBits) == 0, "Slot already marked."); 501Fx.Assert((gateSnapshot & Bits.HiBits) == Bits.LoHiBit, "Slot already empty."); 613Fx.Assert(iots != null, "Overlapped completed without a scheduler."); 643Fx.Assert(this.scheduler == null, "Post called on an overlapped that is already posted."); 644Fx.Assert(iots != null, "Post called with a null scheduler.");
System\Runtime\IOThreadTimer.cs (6)
399Fx.Assert(this.count > 0, "Should have at least one timer in our queue."); 414Fx.Assert(index > 0, ""); 415Fx.Assert(index <= this.count, ""); 445Fx.Assert(timer.index == 0, "Timer should not have an index."); 498Fx.Assert(index > 0, ""); 499Fx.Assert(index <= count, "");
System\Runtime\MruCache.cs (4)
34Fx.Assert(lowWatermark < highWatermark, ""); 35Fx.Assert(lowWatermark >= 0, ""); 60Fx.Assert(null != key, ""); 109Fx.Assert(null != key, "");
System\Runtime\ReadOnlyKeyedCollection.cs (1)
16Fx.Assert(innerCollection != null, "innerCollection should not be null");
System\Runtime\ThreadNeutralSemaphore.cs (3)
41Fx.Assert(maxCount > 0, "maxCount must be positive"); 74Fx.Assert(callback != null, "must have a non-null call back for async purposes"); 114Fx.Assert(!thisPtr.waiters.Contains(data.Waiter), "The waiter should have been removed already.");
System\Runtime\TimeoutHelper.cs (2)
19Fx.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 142Fx.Assert(!deadlineSet, "TimeoutHelper deadline set twice.");
System\Runtime\TypeHelper.cs (2)
64Fx.Assert(!sourceType.IsValueType && !destinationType.IsValueType, "AreReferenceTypesCompatible can only be used for reference types"); 312Fx.Assert(source != null, "caller must verify");
System\Runtime\UrlUtility.cs (1)
358Fx.Assert(n < 0x10, "n < 0x10");