31 references to Throws
Microsoft.Build.Engine.UnitTests (1)
Evaluation\SimpleVersion_Tests.cs (1)
280
Assert.
Throws
(exceptionType, () => SimpleVersion.Parse(input));
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 (7)
ExceptionAssertsTests.cs (7)
90
Assert.Throws<ArgumentNullException>("exceptionType", () => Assert.
Throws
(null!, testCode));
91
Assert.Throws<ArgumentNullException>("testCode", () => Assert.
Throws
(typeof(Exception), default(Func<object>)!));
99
var ex = Record.Exception(() => Assert.
Throws
(typeof(Exception), testCode));
110
var ex = Record.Exception(() => Assert.
Throws
(typeof(ArgumentException), testCode));
126
Assert.
Throws
(typeof(ArgumentException), testCode);
135
var ex = Record.Exception(() => Assert.
Throws
(typeof(ArgumentException), testCode));
153
var ex = Record.Exception(() => Assert.
Throws
(typeof(ArgumentException), testCode));
System.Drawing.Common.Tests (6)
System\Drawing\ColorTranslatorTests.cs (1)
231
Assert.
Throws
(exception, () => ColorTranslator.FromHtml(htmlColor));
System\Drawing\IconTests.cs (1)
215
Assert.
Throws
(exceptionType, () => new Icon(stream));
System\Drawing\Imaging\EncoderParameterTests.cs (4)
222
Assert.
Throws
(expected, () => new EncoderParameter(s_anyEncoder, numerator1, denominator1, numerator2, denominator2));
239
Assert.
Throws
(expected, () => new EncoderParameter(s_anyEncoder, numerator, denominator));
249
Assert.
Throws
(expected, () => new EncoderParameter(s_anyEncoder, rangeBegin, rangeEnd));
310
Assert.
Throws
(expected, () => new EncoderParameter(s_anyEncoder, numberOfValues, type, IntPtr.Zero));