/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/DataProtection/shared/test/ExceptionAssert2.cs
22 строки
873 B
William Godbe
Rename Microsoft.Aspnetcore.Testing to Microsoft.AspNetCore.InternalTesting (#51713)
02 ноя 2023, 03:15
Не верифицирован
02 ноя 2023, 03:15
fc8deca
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Security.Cryptography; using Xunit; namespace Microsoft.AspNetCore.InternalTesting; internal static class ExceptionAssert2 { /// <summary> /// Verifies that the code throws a <see cref="CryptographicException"/>. /// </summary> /// <param name="testCode">A delegate to the code to be tested</param> /// <returns>The <see cref="CryptographicException"/> that was thrown, when successful</returns> /// <exception>Thrown when an exception was not thrown, or when an exception of the incorrect type is thrown</exception> public static CryptographicException ThrowsCryptographicException(Action testCode) { return Assert.Throws<CryptographicException>(testCode); } }