27 references to Throws
Microsoft.CodeAnalysis.UnitTests (13)
Collections\List\ICollection.Generic.Tests.cs (1)
514Assert.Throws(ICollection_Generic_CopyTo_IndexLargerThanArrayCount_ThrowType, () => collection.CopyTo(array, count + 1));
Collections\List\ICollection.NonGeneric.Tests.cs (6)
194Assert.Throws(ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowType, () => collection.CopyTo(arr, 0)); 206Assert.Throws(ICollection_NonGeneric_CopyTo_NonZeroLowerBound_ThrowType, () => collection.CopyTo(arr, 0)); 218Assert.Throws(ICollection_NonGeneric_CopyTo_ArrayOfIncorrectValueType_ThrowType, () => collection.CopyTo(array, 0)); 230Assert.Throws(ICollection_NonGeneric_CopyTo_ArrayOfIncorrectReferenceType_ThrowType, () => collection.CopyTo(array, 0)); 242Assert.Throws(ICollection_NonGeneric_CopyTo_ArrayOfEnumType_ThrowType, () => collection.CopyTo(enumArr, 0)); 275Assert.Throws(ICollection_NonGeneric_CopyTo_IndexLargerThanArrayCount_ThrowType, () => collection.CopyTo(array, count + 1));
Collections\List\IList.NonGeneric.Tests.cs (6)
739Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.Insert(-1, validAdd)); 740Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.Insert(int.MinValue, validAdd)); 1017Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(-1)); 1018Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(int.MinValue)); 1031Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(count)); 1032Assert.Throws(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(count + 1));
Microsoft.DotNet.XUnitAssert.Tests (6)
ExceptionAssertsTests.cs (6)
18 Assert.Throws<ArgumentNullException>("exceptionType", () => Assert.Throws(null!, testCode)); 19 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Action)!)); 27 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 43 Assert.Throws(typeof(ArgumentException), testCode); 52 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 70 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode));
System.Windows.Forms.Design.Tests (4)
System\ComponentModel\Design\ComponentDesignerTests.cs (4)
1265Assert.Throws(exception.GetType(), () => designer.DoDefaultAction()); 1276Assert.Throws(exception.GetType(), () => designer.DoDefaultAction()); 1557Assert.Throws(exception.GetType(), () => designer.DoDefaultAction()); 1570Assert.Throws(exception.GetType(), () => designer.DoDefaultAction());
System.Windows.Forms.Primitives.TestUtilities (3)
Extensions\AssertExtensions.cs (3)
158Exception exception = Assert.Throws(typeof(TNetFxExceptionType), action); 183return Assert.Throws(netFxExceptionType, action); 187return Assert.Throws(netCoreExceptionType, action);
System.Windows.Forms.Tests (1)
System\Windows\Forms\BindingTests.cs (1)
397Assert.Throws(exception.GetType(), () => binding.OnBindingComplete(eventArgs));