31 references to Throws
Microsoft.Build.Engine.UnitTests (1)
Evaluation\SimpleVersion_Tests.cs (1)
280Assert.Throws(exceptionType, () => SimpleVersion.Parse(input));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxFactoryTests.cs (1)
134Assert.Throws(exceptionType, () => SyntaxFactory.Token(default(SyntaxTriviaList), SyntaxKind.IdentifierName, "text", "valueText", default(SyntaxTriviaList)));
Microsoft.CodeAnalysis.UnitTests (16)
Collections\List\IList.Generic.Tests.cs (8)
115Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[-1]); 116Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[int.MinValue]); 124Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count]); 125Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count + 1]); 149Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[-1] = validAdd); 150Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[int.MinValue] = validAdd); 163Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count] = validAdd); 164Assert.Throws(IList_Generic_Item_InvalidIndex_ThrowType, () => list[count + 1] = validAdd);
Collections\List\IList.NonGeneric.Tests.cs (8)
220Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[-1]); 221Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[int.MinValue]); 229Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count]); 230Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count + 1]); 254Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[-1] = validAdd); 255Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[int.MinValue] = validAdd); 268Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list[count] = validAdd); 269Assert.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)
231Assert.Throws(exception, () => ColorTranslator.FromHtml(htmlColor));
System\Drawing\IconTests.cs (1)
215Assert.Throws(exceptionType, () => new Icon(stream));
System\Drawing\Imaging\EncoderParameterTests.cs (4)
222Assert.Throws(expected, () => new EncoderParameter(s_anyEncoder, numerator1, denominator1, numerator2, denominator2)); 239Assert.Throws(expected, () => new EncoderParameter(s_anyEncoder, numerator, denominator)); 249Assert.Throws(expected, () => new EncoderParameter(s_anyEncoder, rangeBegin, rangeEnd)); 310Assert.Throws(expected, () => new EncoderParameter(s_anyEncoder, numberOfValues, type, IntPtr.Zero));