本文整理汇总了C#中UserAccount.Init方法的典型用法代码示例。如果您正苦于以下问题:C# UserAccount.Init方法的具体用法?C# UserAccount.Init怎么用?C# UserAccount.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount.Init方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExistingID_Throws
public void ExistingID_Throws()
{
var sub = new UserAccount();
sub.ID = Guid.NewGuid();
sub.Init("ten", "user", "pass", "email");
}
示例2: EmptyPass_Throws
public void EmptyPass_Throws()
{
var sub = new UserAccount();
sub.Init("ten", "user", "", "email");
}
示例3: EmptyEmail_Throws
public void EmptyEmail_Throws()
{
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "");
}
示例4: EmptyTenant_Throws
public void EmptyTenant_Throws()
{
var sub = new UserAccount();
sub.Init("", "user", "pass", "email");
}
示例5: EmptyUsername_Throws
public void EmptyUsername_Throws()
{
var sub = new UserAccount();
sub.Init("ten", "", "pass", "email");
}
示例6: NullPass_Throws
public void NullPass_Throws()
{
var sub = new UserAccount();
sub.Init("ten", "user", null, "email");
}
示例7: NullEmail_Throws
public void NullEmail_Throws()
{
var sub = new UserAccount();
sub.Init("ten", "user", "pass", null);
}
示例8: NullUsername_Throws
public void NullUsername_Throws()
{
var sub = new UserAccount();
sub.Init("ten", null, "pass", "email");
}
示例9: NullTenant_Throws
public void NullTenant_Throws()
{
var sub = new UserAccount();
sub.Init(null, "user", "pass", "email");
}
示例10: IsAccountVerified_SetProperly
public void IsAccountVerified_SetProperly()
{
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.RequireAccountVerification = true;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsFalse(sub.IsAccountVerified);
}
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.RequireAccountVerification = false;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsTrue(sub.IsAccountVerified);
}
}
示例11: Verification_SetProperly
public void Verification_SetProperly()
{
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.RequireAccountVerification = true;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsNotNull(sub.VerificationKey);
Assert.IsNotNull(sub.VerificationKeySent);
}
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.RequireAccountVerification = false;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsNull(sub.VerificationKey);
Assert.IsNull(sub.VerificationKeySent);
}
}
示例12: IsLoginAllowed_SetProperly
public void IsLoginAllowed_SetProperly()
{
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.AllowLoginAfterAccountCreation = true;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsTrue(sub.IsLoginAllowed);
}
{
SecuritySettings.Instance = new SecuritySettings();
SecuritySettings.Instance.AllowLoginAfterAccountCreation = false;
var sub = new UserAccount();
sub.Init("ten", "user", "pass", "email");
Assert.IsFalse(sub.IsLoginAllowed);
}
}