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