/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Security/Authorization/test/MetadataTest.cs
37 строк
957 B
James Newton-King
Improve endpoint metadata debugging (#48207)
19 май 2023, 04:28
Не верифицирован
19 май 2023, 04:28
ba58563
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Authorization; namespace Microsoft.AspNetCore.Authorization.Test; public class MetadataTest { [Fact] public void AuthorizeAttribute_PropertiesNull_ToString() { // Arrange var metadata = new AuthorizeAttribute(); // Act var value = metadata.ToString(); // Assert Assert.Equal("Authorize", value); } [Fact] public void AuthorizeAttribute_PropertiesValues_ToString() { // Arrange var metadata = new AuthorizeAttribute("Name"); metadata.Roles = "Role1"; metadata.AuthenticationSchemes = "Scheme1"; // Act var value = metadata.ToString(); // Assert Assert.Equal("Authorize Policy: Name, Roles: Role1, AuthenticationSchemes: Scheme1", value); } }