本文整理汇总了C#中UserAccount.RemoveClaim方法的典型用法代码示例。如果您正苦于以下问题:C# UserAccount.RemoveClaim方法的具体用法?C# UserAccount.RemoveClaim怎么用?C# UserAccount.RemoveClaim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount.RemoveClaim方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MutipleClaimsFound_RemovesClaims
public void MutipleClaimsFound_RemovesClaims()
{
var sub = new UserAccount();
sub.Claims = new List<UserClaim>()
{
new UserClaim{Type="type1", Value = "value1"},
new UserClaim{Type="type1", Value = "value1"},
new UserClaim{Type="type2", Value = "value2"},
};
sub.RemoveClaim("type1", "value1");
Assert.AreEqual(1, sub.Claims.Count);
Assert.AreEqual("type2", sub.Claims.First().Type);
Assert.AreEqual("value2", sub.Claims.First().Value);
}
示例2: ClaimNotFound_RemovesNoClaims
public void ClaimNotFound_RemovesNoClaims()
{
var sub = new UserAccount();
sub.Claims = new List<UserClaim>()
{
new UserClaim{Type="type1", Value = "value1"}
};
sub.RemoveClaim("type1", "value2");
sub.RemoveClaim("type2", "value1");
Assert.AreEqual(1, sub.Claims.Count);
}
示例3: EmptyValue_Throws
public void EmptyValue_Throws()
{
var sub = new UserAccount();
sub.RemoveClaim("type", "");
}
示例4: NullValue_Throws
public void NullValue_Throws()
{
var sub = new UserAccount();
sub.RemoveClaim("type", null);
}
示例5: EmptyType_Throws
public void EmptyType_Throws()
{
var sub = new UserAccount();
sub.RemoveClaim("", "value");
}
示例6: NullType_Throws
public void NullType_Throws()
{
var sub = new UserAccount();
sub.RemoveClaim(null, "value");
}