489 references to Assert
Aspire.Dashboard (1)
CodeStyleConfigFileGenerator (1)
GenerateDocumentationAndConfigFiles (1)
http2cat (2)
IIS.FunctionalTests (2)
IIS.LongTests (2)
IIS.NewHandler.FunctionalTests (2)
IIS.NewShim.FunctionalTests (2)
IISExpress.FunctionalTests (2)
IOperationGenerator (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Http.Results (1)
Microsoft.AspNetCore.Mvc.Abstractions (1)
Microsoft.AspNetCore.OpenApi (3)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Microsoft.AspNetCore.Shared.Tests (2)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CSharp (5)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Microsoft.Extensions.AI.Abstractions (2)
Microsoft.Extensions.AI.OpenAI (7)
src\Shared\ServerSentEvents\SseParser_1.cs (6)
282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}");
283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}");
284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}");
286Debug.Assert(searchLength >= 0, $"{searchLength}");
287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}");
548Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
Microsoft.Extensions.Logging.Console (1)
Microsoft.Extensions.Validation.GeneratorTests (1)
PresentationBuildTasks (4)
PresentationFramework (15)
Shared (7)
ServerSentEvents\SseParser_1.cs (6)
282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}");
283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}");
284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}");
286Debug.Assert(searchLength >= 0, $"{searchLength}");
287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}");
548Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
System.Collections (1)
System.Collections.Concurrent (4)
System.ComponentModel.TypeConverter (7)
System.Data.Common (37)
System\Data\Filter\FunctionNode.cs (18)
321Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
332Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
344Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
348Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
352Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
356Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
360Debug.Assert(_argumentCount == 2, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
362Debug.Assert(argumentValues[0] is string, $"Invalid argument type for {s_funcs[_info]._name}");
363Debug.Assert(argumentValues[1] is string, $"Invalid argument type for {s_funcs[_info]._name}");
377Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}");
404Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
405Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
423Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}");
424Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid first argument {argumentValues[0].GetType().FullName} in {s_funcs[_info]._name}");
425Debug.Assert(argumentValues[1] is int, $"Invalid second argument {argumentValues[1].GetType().FullName} in {s_funcs[_info]._name}");
426Debug.Assert(argumentValues[2] is int, $"Invalid third argument {argumentValues[2].GetType().FullName} in {s_funcs[_info]._name}");
465Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
466Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
System.Data.Odbc (6)
System.Drawing.Primitives (1)
System.Formats.Asn1 (3)
System.Formats.Tar (1)
System.IO.Ports (1)
System.Linq.Expressions (3)
System.Net.HttpListener (1)
System.Net.Mail (12)
System.Net.Ping (5)
System.Net.ServerSentEvents (7)
System\Net\ServerSentEvents\SseParser_1.cs (6)
266Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}");
267Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}");
268Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}");
270Debug.Assert(searchLength >= 0, $"{searchLength}");
271Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}");
524Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
System.Numerics.Tensors (1)
System.Private.CoreLib (56)
System.Private.DataContractSerialization (1)
System.Private.Uri (3)
System.Private.Xml (42)
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (17)
419Debug.Assert(_xstate == XmlState.WithinSequence, $"StartTree cannot be called in the {_xstate} state.");
430Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"EndTree cannot be called in the {_xstate} state.");
446Debug.Assert(_xstate == XmlState.WithinContent, $"WriteStartElement cannot be called in the {_xstate} state.");
469Debug.Assert(_xstate == XmlState.EnumAttrs, $"StartElementContent cannot be called in the {_xstate} state.");
484Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"WriteEndElement cannot be called in the {_xstate} state.");
504Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteStartAttribute cannot be called in the {_xstate} state.");
523Debug.Assert(_xstate == XmlState.WithinAttr, $"WriteEndAttribute cannot be called in the {_xstate} state.");
539Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteNamespaceDeclaration cannot be called in the {_xstate} state.");
572Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlock cannot be called in the {_xstate} state.");
581Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlockNoEntities cannot be called in the {_xstate} state.");
762Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteNamespaceString cannot be called in the {_xstate} state.");
771Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteEndNamespace cannot be called in the {_xstate} state.");
801Debug.Assert(_xstate == XmlState.WithinComment, $"WriteCommentString cannot be called in the {_xstate} state.");
810Debug.Assert(_xstate == XmlState.WithinComment, $"WriteEndComment cannot be called in the {_xstate} state.");
844Debug.Assert(_xstate == XmlState.WithinPI, $"WriteProcessingInstructionString cannot be called in the {_xstate} state.");
853Debug.Assert(_xstate == XmlState.WithinPI, $"WriteEndProcessingInstruction cannot be called in the {_xstate} state.");
1206Debug.Assert(_xstate == XmlState.WithinContent, $"EndCopy cannot be called in the {_xstate} state.");
System.Reflection.Metadata (2)
System.Resources.Extensions (3)
System.Resources.Writer (1)
System.Runtime.Caching (1)
System.Runtime.Numerics (2)
System.Security.Cryptography.Pkcs (5)
src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (1)
119Debug.Assert(
System.Text.Encoding.CodePages (16)
System.Text.Json (25)
System\Text\Json\BitStack.cs (7)
80Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}");
83Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}");
92Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}");
96Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}");
145Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}");
149Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}");
165Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}");
System.Text.RegularExpressions (67)
System\Text\RegularExpressions\RegexCompiler.cs (41)
1648Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}");
1649Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
1853Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}");
2028Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}");
2029Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}");
2187Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
2188Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}");
2387Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}");
2388Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2513Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}");
2514Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2564Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}");
2565Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2829Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
2830Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}");
2871Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}");
2891Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}");
2892Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
2962Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
3037Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.Kind}");
3081Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}");
3219Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}");
3271Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}");
3487Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}");
3834Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
3835Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
3836Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
3837Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
4207Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
4356Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4603Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4692Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
4693Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
4694Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}");
4695Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
4696Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}");
4730Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
4731Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
4732Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
4733Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
6156Debug.Assert(chars.Length > 3, $"chars.Length == {chars.Length}");
System\Text\RegularExpressions\RegexNode.cs (12)
216Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}");
258Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}.");
267Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}.");
271Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}");
275Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}");
280Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}.");
293Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters");
300Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}.");
304Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\".");
315Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase");
2520Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
2636Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
System.Threading.Channels (1)
System.Threading.Tasks.Parallel (2)
System.Windows.Forms (56)
System.Windows.Forms.Design (35)
System.Windows.Forms.IntegrationTests.Common (1)
System.Windows.Forms.Primitives (2)
Test.Utilities (1)