You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sae_2a_anglais/Project/adminBlazor/TestUnit/CurrentUser_UT.cs

29 lines
860 B

using adminBlazor.Models;
namespace TestUnit
{
public class CurrentUser_UT
{
public static IEnumerable<object[]> SimpleAttributes()
{
yield return new object[]
{
new Dictionary<string, string>(),
false,
"username"
};
}
[Theory]
[MemberData(nameof(SimpleAttributes))]
public void SimpleAttribut_Validation(Dictionary<string, string> claims, bool isAuthenticated, string username)
{
var currentUser = new CurrentUser { Claims = claims, IsAuthenticated = isAuthenticated, UserName = username };
Assert.Equal(claims, currentUser.Claims);
Assert.Equal(isAuthenticated, currentUser.IsAuthenticated);
Assert.Equal(username, currentUser.UserName);
}
}
}