/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Testing/test/ExceptionAssertTest.cs
38 строк
1 KB
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 Xunit; namespace Microsoft.AspNetCore.InternalTesting; public class ExceptionAssertTest { [Fact] [ReplaceCulture("fr-FR", "fr-FR")] public void AssertArgumentNullOrEmptyString_WorksInNonEnglishCultures() { // Arrange Action action = () => { throw new ArgumentException("Value cannot be null or an empty string.", "foo"); }; // Act and Assert ExceptionAssert.ThrowsArgumentNullOrEmptyString(action, "foo"); } [Fact] [ReplaceCulture("fr-FR", "fr-FR")] public void AssertArgumentOutOfRangeException_WorksInNonEnglishCultures() { // Arrange Action action = () => { throw new ArgumentOutOfRangeException("foo", 10, "exception message."); }; // Act and Assert ExceptionAssert.ThrowsArgumentOutOfRange(action, "foo", "exception message.", 10); } }