25 references to Throws
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxFactoryTests.cs (1)
134
Assert.
Throws
(exceptionType, () => SyntaxFactory.Token(default(SyntaxTriviaList), SyntaxKind.IdentifierName, "text", "valueText", default(SyntaxTriviaList)));
Microsoft.CodeAnalysis.UnitTests (16)
Collections\List\IList.Generic.Tests.cs (8)
115
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[-1]);
116
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[int.MinValue]);
124
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count]);
125
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count + 1]);
149
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[-1] = validAdd);
150
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[int.MinValue] = validAdd);
163
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count] = validAdd);
164
Assert.
Throws
(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count + 1] = validAdd);
Collections\List\IList.NonGeneric.Tests.cs (8)
220
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[-1]);
221
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[int.MinValue]);
229
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count]);
230
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count + 1]);
254
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[-1] = validAdd);
255
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[int.MinValue] = validAdd);
268
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count] = validAdd);
269
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count + 1] = validAdd);
Microsoft.DotNet.XUnitAssert.Tests (6)
ExceptionAssertsTests.cs (6)
488
Assert.
Throws
(typeof(Exception), () => throw new InvalidOperationException());
499
var ex = Assert.
Throws
(typeof(ArgumentException), () => throw new ArgumentException());
513
var ex = Record.Exception(() => Assert.
Throws
(typeof(Exception), testCode));
526
Assert.
Throws
(typeof(ArgumentException), () => accessor.SuccessfulProperty);
541
Assert.
Throws
(typeof(Exception), () => accessor.FailingProperty);
554
var ex = Assert.
Throws
(typeof(InvalidOperationException), () => accessor.FailingProperty);
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\DataContentTests.cs (1)
46
Assert.
Throws
(exception, () => new DataContent(path));
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Classification\DataClassificationTypeConverterTests.cs (1)
144
Assert.
Throws
(expectedException, act);