27 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));
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\DataContentTests.cs (1)
46Assert.Throws(exception, () => new DataContent(path));
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Classification\DataClassificationTypeConverterTests.cs (1)
144Assert.Throws(expectedException, act);