126 references to Assert
dotnet-svcutil-lib (67)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ActionItem.cs (1)
36Contract.Assert(callback != null, "Cannot schedule a null callback");
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (3)
136Contract.Assert(task != null, "IAsyncResult must be an instance of Task<TResult>"); 145Contract.Assert(task != null, "IAsyncResult must be an instance of Task"); 256Contract.Assert(state != null, "Async state should be of type TaskCompletionSource<bool>");
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (2)
26Contract.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 179Contract.Assert(!_deadlineSet, "TimeoutHelper deadline set twice.");
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\X509CertificateValidator.cs (1)
69Contract.Assert(useMachineContext == false, "CoreCLR does not have ctor allowing useMachineContext = true");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (4)
47Contract.Assert(stream != Null, "stream!=Null"); 48Contract.Assert(bufferSize > 0, "bufferSize>0"); 202Contract.Assert(_buffer != null && _bufferSize >= _writePos, 212Contract.Assert(_buffer != null && _bufferSize >= _writePos,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (2)
32Contract.Assert(channelFactory != null, "connection factory must be set"); 192Contract.Assert(_connectionFactory != null, "Invalid call: CreateWebSocketWithFactory.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (2)
458Contract.Assert(stream != null, "StreamConnection: Stream cannot be null."); 459Contract.Assert(innerStream != null, "StreamConnection: Inner stream cannot be null.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionBufferPool.cs (3)
30Contract.Assert(bufferSize >= 0, "bufferSize must be non-negative"); 31Contract.Assert(batchCount > 0, "batchCount must be positive"); 32Contract.Assert(maxFreeCount >= 0, "maxFreeCount must be non-negative");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionOrientedTransportChannelFactory.cs (1)
279Contract.Assert(_connectionPool != null, "ConnectionPool should always be found");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPool.cs (1)
134Contract.Assert(result != null, "EndpointPool must be non-null at this point");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (6)
377Contract.Assert(!_asyncWritePending, "Called BeginWrite twice."); 438Contract.Assert(false, "SocketConnection.EndWrite called with no write pending."); 454Contract.Assert(eventArgs != null, "Argument 'eventArgs' cannot be NULL."); 460Contract.Assert(eventArgs.BytesTransferred == _asyncWriteEventArgs.Count, "The socket SendAsync did not send all the bytes."); 694Contract.Assert(eventArgs != null, "Argument 'eventArgs' cannot be NULL."); 741Contract.Assert(false, "SocketConnection.EndRead called with no read pending.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (1)
107Contract.Assert(false, "Streamed output should never be called in this channel.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
540Contract.Assert(authScheme.IsSingleton(), "authenticationScheme used in an Http(s)ChannelFactory must be a singleton value.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelHelpers.cs (1)
128Contract.Assert(exception.InnerException != null, "InnerException must be set to be able to convert");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (6)
25Contract.Assert(httpRequestMessage != null, "The 'httpRequestMessage' parameter should not be null."); 26Contract.Assert(message != null, "The 'message' parameter should not be null."); 35Contract.Assert(httpHeaders != null, "httpHeaders should not be null."); 48Contract.Assert(messageProperties != null, "The 'messageProperties' parameter should not be null."); 49Contract.Assert(properties != null, "The 'properties' parameter should not be null."); 70Contract.Assert(httpRequestMessage != null, "The 'httpRequestMessage' parameter should never be null.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (1)
266Contract.Assert(httpRequestMessage != null, "The 'httpRequestMessage' property should never be null.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
60Contract.Assert(exception == null, "ProcessHttpAddressing should not set an exception after parsing a response message.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (1)
293Contract.Assert(httpResponseMessage != null, "The 'httpResponseMessage' property should never be null.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (1)
97Contract.Assert(actionParams.Length <= 1, "action MUST only appear as a content type parameter at most 1 time");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\QueuedObjectPool.cs (3)
43Contract.Assert(batchAllocCount <= maxFreeCount, "batchAllocCount cannot be greater than maxFreeCount"); 75Contract.Assert(!_isClosed, "Cannot take an item from closed QueuedObjectPool"); 111Contract.Assert(_objectQueue.Count == 0, "The object queue must be empty for new allocations");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (2)
174Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL."); 216Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (2)
47Contract.Assert(connectionBufferPool != null, "Argument connectionBufferPool cannot be null"); 262Contract.Assert(timeoutErrorString != null, "Argument timeoutErrorString must not be null.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (1)
398Contract.Assert(certificate != null, "certificate MUST NOT be null");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (3)
580Contract.Assert(xmlWriter != null, "xmlWriter MUST NOT be null"); 722Contract.Assert(xmlReader != null, "xmlReader MUST NOT be null"); 762Contract.Assert(writer != null, "writer MUST NOT be null");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TimeoutStream.cs (2)
51Contract.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable"); 78Contract.Assert(!cancellationToken.CanBeCanceled, "cancellationToken shouldn't be cancellable");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (5)
188Contract.Assert(callback != null, "callback should not be null."); 203Contract.Assert(_pendingWritingMessageException == null, "'pendingWritingMessageException' MUST be NULL at this point."); 986Contract.Assert(value >= -1, "ReadTimeout should not be negative."); 1001Contract.Assert(value >= -1, "WriteTimeout should not be negative."); 1019Contract.Assert(_messageSource != null, "messageSource should not be null in read case.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WindowsStreamSecurityUpgradeProvider.cs (1)
40Contract.Assert(isClient, ".NET Core and .NET Native does not support server side");
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\CustomAttributeProvider.cs (3)
73Contract.Assert(false, "This should never execute."); 92Contract.Assert(false, "This should never execute."); 109Contract.Assert(false, "This should never execute.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PerSessionInstanceContextProvider.cs (1)
28Contract.Assert((serviceChannel != null), "System.ServiceModel.Dispatcher.PerSessionInstanceContextProvider.GetExistingInstanceContext(), serviceChannel != null");
FrameworkFork\System.ServiceModel\System\ServiceModel\NetTcpSecurity.cs (1)
27Contract.Assert(SecurityModeHelper.IsDefined(mode),
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceModelStringsVersion1.cs (1)
507Contract.Assert(index >= 0 && index < this.Count, "check index");
FrameworkFork\System.ServiceModel\System\ServiceModel\TimeSpanHelper.cs (3)
15Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 21Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 27Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
Microsoft.AspNetCore.Http (2)
src\Shared\HttpRuleParser.cs (2)
267Contract.Assert(false, "'NotParsed' is unexpected: We started nested expression " + 277Contract.Assert(false, "Unknown enum result: " + nestedResult);
Microsoft.AspNetCore.Mvc.Core (2)
src\Shared\HttpRuleParser.cs (2)
267Contract.Assert(false, "'NotParsed' is unexpected: We started nested expression " + 277Contract.Assert(false, "Unknown enum result: " + nestedResult);
Microsoft.AspNetCore.Routing (2)
src\Shared\HttpRuleParser.cs (2)
267Contract.Assert(false, "'NotParsed' is unexpected: We started nested expression " + 277Contract.Assert(false, "Unknown enum result: " + nestedResult);
Microsoft.AspNetCore.TestHost (2)
ClientHandler.cs (2)
205Contract.Assert(success, "Bad trailer"); 224Contract.Assert(success, "Bad header");
Microsoft.Cci.Extensions (6)
Extensions\DocIdExtensions.cs (1)
83Contract.Assert(false, string.Format("Fell through cases in TypeExtensions.RefDocId() Type of reference: {0}", reference.GetType()));
Extensions\TypeExtensions.cs (2)
263Contract.Assert(false, String.Format("Fell through cases in TypeExtensions.FullName() Type of reference: {0}", reference.GetType())); 411Contract.Assert(reference is INamedTypeReference
Traversers\ResolveAllReferencesTraverser.cs (1)
99Contract.Assert(!(aliasForType.AliasedType is Dummy), "The aliased type should not be a dummy");
Writers\CSharp\CSDeclarationWriter.Methods.cs (1)
181Contract.Assert(method is not IGenericMethodInstance, "Currently don't support generic method instances");
Writers\CSharp\CSDeclarationWriter.Types.cs (1)
81Contract.Assert(!(type is IGenericTypeInstance), "Currently don't support generic type instances if we hit this then add support");
Microsoft.ML.Core (3)
SearchSpace\ChoiceAttribute.cs (3)
23Contract.Assert(candidatesType.Count() == 1, "multiple candidates type detected"); 34Contract.Assert(candidatesType.Count() == 1, "multiple candidates type detected"); 35Contract.Assert(candidatesType.First() == defaultValue.GetType(), "candidates type doesn't match with defaultValue type");
Microsoft.ML.GenAI.Core (1)
Module\Attention.cs (1)
112Contract.Assert(this._hiddenSize % (this._headDim * this._numHeads) == 0, "hidden_size must be divisible by num_heads");
Microsoft.ML.GenAI.Phi (2)
Module\Phi2Attention.cs (1)
70Contract.Assert(this._hiddenSize % (this._headDim * this._numAttentionHeads) == 0, "hidden_size must be divisible by num_attention_heads");
Module\Phi2Model.cs (1)
111Contract.Assert(seqLen == queryLength, "seqLen must be equal to queryLength");
Microsoft.ML.SearchSpace (16)
Option\ChoiceOption.cs (4)
28Contract.Assert(choices.Length > 0 && choices.Length < 1074, "the length of choices must be (0, 1074)"); 30Contract.Assert(distinctChoices.Count() == choices.Length, "choices must not contain repeated values"); 69Contract.Assert(x >= 0, $"{param} not contains"); 77Contract.Assert(values.Length >= 0, "values length must be greater than 0");
Option\UniformNumericOption.cs (5)
27Contract.Assert(max > min, "max must be larger than min."); 28Contract.Assert(min > 0 || logBase == false, "min must be larger than 0 if logBase is true."); 60Contract.Assert(x <= Max && x >= Min, $"{x} is not within [{Min}, {Max}]"); 78Contract.Assert(values.Length == 1, "values length must be 1"); 80Contract.Assert(value <= 1 && value >= 0, $"{value} must be between [0,1]");
Parameter.cs (1)
360Contract.Assert(ParameterType == ParameterType.Object, "parameter is not object type.");
SearchSpace.cs (6)
111Contract.Assert(feature.Length == FeatureSpaceDim, "input feature doesn't match"); 206Contract.Assert(attributes.Count() <= 1, $"{field.Name} can only define one of the choice|range|option attribute"); 253Contract.Assert(attributes.Count() <= 1, $"{property.Name} can only define one of the choice|range|option attribute"); 291Contract.Assert(type == typeof(bool), $"[Option:{optionName}] BooleanChoice can only apply to property or field which type is bool"); 297Contract.Assert(type != typeof(int) && type != typeof(short) && type != typeof(long), $"[Option:{optionName}] UniformDoubleOption or UniformSingleOption can't apply to property or field which type is int or short or long"); 304Contract.Assert(supportTypes.Contains(type) || type.IsEnum, $"[Option:{optionName}] ChoiceAttribute can only apply to enum or the following types {string.Join(",", supportTypes.Select(x => x.Name))}");
Microsoft.Net.Http.Headers (4)
HeaderUtilities.cs (1)
144Contract.Assert(Contract.ForAll(alreadyFound, value => { return value; }),
RangeHeaderValue.cs (1)
192Contract.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
src\Shared\HttpRuleParser.cs (2)
267Contract.Assert(false, "'NotParsed' is unexpected: We started nested expression " + 277Contract.Assert(false, "Unknown enum result: " + nestedResult);
System.ServiceModel.Federation (4)
System\Runtime\TaskHelpers.cs (2)
131Contract.Assert(task != null, "IAsyncResult must be an instance of Task<TResult>"); 140Contract.Assert(task != null, "IAsyncResult must be an instance of Task");
System\Runtime\TimeoutHelper.cs (2)
19Contract.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 139Contract.Assert(!_deadlineSet, "TimeoutHelper deadline set twice.");
System.ServiceModel.NetFramingBase (8)
System\ServiceModel\Channels\Connection.cs (2)
285Contract.Assert(stream != null, "StreamConnection: Stream cannot be null."); 286Contract.Assert(innerStream != null, "StreamConnection: Inner stream cannot be null.");
System\ServiceModel\Channels\ConnectionPool.cs (1)
133Contract.Assert(result != null, "EndpointPool must be non-null at this point");
System\ServiceModel\Channels\FramingChannels.cs (1)
77Contract.Assert(false, "Streamed output should never be called in this channel.");
System\ServiceModel\Channels\NetFramingTransportChannelFactory.cs (1)
309Contract.Assert(_connectionPool != null, "ConnectionPool should always be found");
System\ServiceModel\TimeSpanHelper.cs (3)
14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.NetNamedPipe (3)
System\ServiceModel\TimeSpanHelper.cs (3)
14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.UnixDomainSocket (4)
System\ServiceModel\TimeSpanHelper.cs (3)
14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System\ServiceModel\UnixDomainSocketSecurity.cs (1)
28Contract.Assert(UnixDomainSocketSecurityModeHelper.IsDefined(mode),