27 references to Throws
Microsoft.CodeAnalysis.UnitTests (13)
Collections\List\ICollection.Generic.Tests.cs (1)
514
Assert.
Throws
(ICollection_Generic_CopyTo_IndexLargerThanArrayCount_ThrowType, () => collection.CopyTo(array, count + 1));
Collections\List\ICollection.NonGeneric.Tests.cs (6)
194
Assert.
Throws
(ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowType, () => collection.CopyTo(arr, 0));
206
Assert.
Throws
(ICollection_NonGeneric_CopyTo_NonZeroLowerBound_ThrowType, () => collection.CopyTo(arr, 0));
218
Assert.
Throws
(ICollection_NonGeneric_CopyTo_ArrayOfIncorrectValueType_ThrowType, () => collection.CopyTo(array, 0));
230
Assert.
Throws
(ICollection_NonGeneric_CopyTo_ArrayOfIncorrectReferenceType_ThrowType, () => collection.CopyTo(array, 0));
242
Assert.
Throws
(ICollection_NonGeneric_CopyTo_ArrayOfEnumType_ThrowType, () => collection.CopyTo(enumArr, 0));
275
Assert.
Throws
(ICollection_NonGeneric_CopyTo_IndexLargerThanArrayCount_ThrowType, () => collection.CopyTo(array, count + 1));
Collections\List\IList.NonGeneric.Tests.cs (6)
739
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.Insert(-1, validAdd));
740
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.Insert(int.MinValue, validAdd));
1017
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(-1));
1018
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(int.MinValue));
1031
Assert.
Throws
(IList_NonGeneric_Item_InvalidIndex_ThrowType, () => list.RemoveAt(count));
1032
Assert.
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)
1265
Assert.
Throws
(exception.GetType(), designer.DoDefaultAction);
1276
Assert.
Throws
(exception.GetType(), designer.DoDefaultAction);
1557
Assert.
Throws
(exception.GetType(), designer.DoDefaultAction);
1570
Assert.
Throws
(exception.GetType(), designer.DoDefaultAction);
System.Windows.Forms.Primitives.TestUtilities (3)
Extensions\AssertExtensions.cs (3)
158
Exception exception = Assert.
Throws
(typeof(TNetFxExceptionType), action);
183
return Assert.
Throws
(netFxExceptionType, action);
187
return Assert.
Throws
(netCoreExceptionType, action);
System.Windows.Forms.Tests (1)
System\Windows\Forms\BindingTests.cs (1)
397
Assert.
Throws
(exception.GetType(), () => binding.OnBindingComplete(eventArgs));