本文整理汇总了C#中Account.Create方法的典型用法代码示例。如果您正苦于以下问题:C# Account.Create方法的具体用法?C# Account.Create怎么用?C# Account.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account.Create方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAccount
public void CreateAccount()
{
var acct = new Account(GetUniqueAccountCode());
acct.Create();
acct.CreatedAt.Should().NotBe(default(DateTime));
Assert.False(acct.TaxExempt.Value);
}
示例2: CreateAccountWithParameters
public void CreateAccountWithParameters()
{
var acct = new Account(GetUniqueAccountCode())
{
Username = "testuser1",
Email = "[email protected]",
FirstName = "Test",
LastName = "User",
CompanyName = "Test Company",
AcceptLanguage = "en",
VatNumber = "my-vat-number",
TaxExempt = true
};
string address = "123 Faux Street";
acct.Address.Address1 = address;
acct.Create();
acct.Username.Should().Be("testuser1");
acct.Email.Should().Be("[email protected]");
acct.FirstName.Should().Be("Test");
acct.LastName.Should().Be("User");
acct.CompanyName.Should().Be("Test Company");
acct.AcceptLanguage.Should().Be("en");
Assert.Equal("my-vat-number", acct.VatNumber);
Assert.True(acct.TaxExempt.Value);
Assert.Equal(address, acct.Address.Address1);
}
示例3: CloseAccount
public void CloseAccount()
{
var accountCode = GetUniqueAccountCode();
var acct = new Account(accountCode);
acct.Create();
acct.Close();
var getAcct = Accounts.Get(accountCode);
getAcct.State.Should().Be(Account.AccountState.Closed);
}
示例4: LookupBillingInfo
public void LookupBillingInfo()
{
var accountCode = GetUniqueAccountCode();
var info = NewBillingInfo(accountCode);
var account = new Account(accountCode, info);
account.Create();
var get = Accounts.Get(accountCode);
get.BillingInfo.FirstName.Should().Be(info.FirstName);
get.BillingInfo.LastName.Should().Be(info.LastName);
get.BillingInfo.ExpirationMonth.Should().Be(info.ExpirationMonth);
get.BillingInfo.ExpirationYear.Should().Be(info.ExpirationYear);
}
示例5: LookupAccount
public void LookupAccount()
{
var newAcct = new Account(GetUniqueAccountCode())
{
Email = "[email protected]"
};
newAcct.Create();
var account = Accounts.Get(newAcct.AccountCode);
account.Should().NotBeNull();
account.AccountCode.Should().Be(newAcct.AccountCode);
account.Email.Should().Be(newAcct.Email);
}
示例6: buttonNewUser_Click
private void buttonNewUser_Click(object sender, EventArgs e)
{
NewAccountDlg newAccount = new NewAccountDlg();
while (newAccount.ShowDialog() == DialogResult.OK)
{
Account a = new Account(newAccount.textBoxUser.Text, newAccount.textBoxPassword.Text);
a.Create();
this.textBoxUser.Text = newAccount.textBoxUser.Text;
this.textBoxPassword.Text = newAccount.textBoxPassword.Text;
this.DialogResult = DialogResult.OK;
this.Close();
return;
}
}
示例7: CreateTransactionExistingAccountNewBillingInfo
public void CreateTransactionExistingAccountNewBillingInfo()
{
var account = new Account(GetUniqueAccountCode())
{
FirstName = "John",
LastName = "Smith"
};
account.Create();
account.BillingInfo = NewBillingInfo(account);
var transaction = new Transaction(account, 5000, "USD");
transaction.Create();
transaction.CreatedAt.Should().NotBe(default(DateTime));
}
示例8: UpdateAccount
public void UpdateAccount()
{
var acct = new Account(GetUniqueAccountCode());
acct.Create();
acct.LastName = "UpdateTest123";
acct.TaxExempt = true;
acct.VatNumber = "woot";
acct.Update();
var getAcct = Accounts.Get(acct.AccountCode);
acct.LastName.Should().Be(getAcct.LastName);
Assert.True(acct.TaxExempt.Value);
Assert.Equal("woot", acct.VatNumber);
}
示例9: ReopenAccount
public void ReopenAccount()
{
var accountCode = GetUniqueAccountCode();
var acct = new Account(accountCode);
acct.Create();
acct.Close();
acct.Reopen();
var test = Accounts.Get(accountCode);
acct.State.Should().Be(test.State).And.Be(Account.AccountState.Active);
}
示例10: CreateNewAccount
protected Account CreateNewAccount()
{
var account = new Account(GetUniqueAccountCode());
account.Create();
return account;
}
示例11: SetUp
public void SetUp()
{
a = new Account(user, pass);
if (a.Exists)
{
a.Delete();
}
a.Create();
}