mirror of
https://github.com/bitwarden/server.git
synced 2024-11-28 13:15:12 +01:00
bae03feffe
* Revert "Add git blame entry (#2226)" This reverts commit239286737d
. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a
.
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Security.Claims;
|
|
using Bit.Core.Utilities;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.Utilities
|
|
{
|
|
public class ClaimsExtensionsTests
|
|
{
|
|
[Fact]
|
|
public void HasSSOIdP_Returns_True_When_The_Claims_Has_One_Of_Type_IdP_And_Value_Sso()
|
|
{
|
|
var claims = new List<Claim> { new Claim("idp", "sso") };
|
|
Assert.True(claims.HasSsoIdP());
|
|
}
|
|
|
|
[Fact]
|
|
public void HasSSOIdP_Returns_False_When_The_Claims_Has_One_Of_Type_IdP_And_Value_Is_Not_Sso()
|
|
{
|
|
var claims = new List<Claim> { new Claim("idp", "asdfasfd") };
|
|
Assert.False(claims.HasSsoIdP());
|
|
}
|
|
|
|
[Fact]
|
|
public void HasSSOIdP_Returns_False_When_The_Claims_Has_No_One_Of_Type_IdP()
|
|
{
|
|
var claims = new List<Claim> { new Claim("qweqweq", "sso") };
|
|
Assert.False(claims.HasSsoIdP());
|
|
}
|
|
|
|
[Fact]
|
|
public void HasSSOIdP_Returns_False_When_The_Claims_Are_Empty()
|
|
{
|
|
var claims = new List<Claim>();
|
|
Assert.False(claims.HasSsoIdP());
|
|
}
|
|
}
|
|
}
|