本文整理汇总了C#中TechTalk.SpecFlow.Table.CreateInstance方法的典型用法代码示例。如果您正苦于以下问题:C# Table.CreateInstance方法的具体用法?C# Table.CreateInstance怎么用?C# Table.CreateInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TechTalk.SpecFlow.Table
的用法示例。
在下文中一共展示了Table.CreateInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GivenTheFollowingTransaction
public void GivenTheFollowingTransaction(string category, string paymentMethod, Table data)
{
_paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context));
switch (_transactionType)
{
case TransactionTypes.Income:
_transaction = data.CreateInstance<Income>();
_transactionService = new IncomeService(new IncomeRepository(context));
_categoryService = new IncomeCategoryService(new IncomeCategoryRepository(context));
break;
case TransactionTypes.Expense:
_transaction = data.CreateInstance<Expense>();
_transactionService = new ExpenseService(new ExpenseRepository(context));
_categoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context));
break;
}
_paymentMethod = _paymentMethodService.Create(paymentMethod);
_transaction.Method = _paymentMethod;
_transaction.PaymentMethodId = _paymentMethod.Id;
_category = _categoryService.Create(category);
_transaction.Category = _category;
_transaction.CategoryId = _category.Id;
_transaction.Date = DateTime.Today;
_transaction.Id = 1;
_transactionService.Create(_transaction);
}
示例2: GivenTheFollowingTransaction
public void GivenTheFollowingTransaction(string category, string paymentMethod, Table data)
{
_paymentMethodService = new PaymentMethodService(new PaymentMethodRepository(context));
switch (_transactionType)
{
case TransactionTypes.Income:
_transaction = data.CreateInstance<Income>();
_transactionService = new IncomeService(new IncomeRepository(context));
_categoryService = new IncomeCategoryService(new IncomeCategoryRepository(context));
break;
case TransactionTypes.Expense:
_transaction = data.CreateInstance<Expense>();
_transactionService = new ExpenseService(new ExpenseRepository(context));
_categoryService = new ExpenseCategoryService(new ExpenseCategoryRepository(context));
break;
}
if (!string.IsNullOrWhiteSpace(paymentMethod))
{
_paymentMethod = new PaymentMethod(0, paymentMethod);
_transaction.Method = _paymentMethod;
}
if (!string.IsNullOrWhiteSpace(category))
{
_category = new DataClasses.Category(0, category);
_transaction.Category = _category;
}
if (_transaction.Date.Equals(default(DateTime)))
{
_transaction.Date = DateTime.Today;
}
}
示例3: WhenISearchFor
public void WhenISearchFor(Table table)
{
var search = table.CreateInstance<ConstituentSearchCriteria>();
SearchDialog.SetFirstNameToSearch(search.FirstName);
SearchDialog.SetLastNameToSearch(search.LastName);
SearchDialog.Search();
}
示例4: WhenTheAdministratorSubmitsTheFollowingAdminAccountEditPage
public void WhenTheAdministratorSubmitsTheFollowingAdminAccountEditPage(Table table)
{
var controller = CreateTheController();
var result = controller.Edit(table.CreateInstance<AdminAccountEditForm>());
ScenarioContext.Current.Set(result);
}
示例5: WhenIFillSignInFormWithTheFollowingData
public void WhenIFillSignInFormWithTheFollowingData(Table table)
{
var controller = this.GetAccountController();
var signInModel = table.CreateInstance<SignInViewModel>();
var result = controller.SignIn(signInModel);
ScenarioContext.Current.Set(result, "controllerResponse");
}
示例6: ThenThePersonShouldBeLikeTheFollowing
public void ThenThePersonShouldBeLikeTheFollowing(Table table)
{
var person = table.CreateInstance<Person>();
Person.FirstName.Should().Be(person.FirstName);
Person.LastName.Should().Be(person.LastName);
Person.Age.Should().Be(person.Age);
}
示例7: WhenBenefitsOptionsOf
public void WhenBenefitsOptionsOf(Table table)
{
var form = table.CreateInstance<AddMembershipProgramBenefitsOptions>();
AddMembershipProgramDialog.CreateMembershipProgramBenefitsOptionsFormat(form.MembershipFormat);
AddMembershipProgramDialog.CreateMembershipProgramNext();
}
示例8: x
public void x(Table table)
{
var form = table.CreateInstance<CreateAccountForm>();
var controller = new AccountController(Database.Open());
controller.Create(form);
}
示例9: WhenIEnterTheFollowingInformation
public void WhenIEnterTheFollowingInformation(Table enteredInformation)
{
var createVm = enteredInformation.CreateInstance<AddKanbanBoardCommand>();
var controller = CreateController();
var viewResult = controller.Create(createVm);
ScenarioContext.Current.Set(viewResult);
}
示例10: GivenIHaveFollowingProducts
public void GivenIHaveFollowingProducts(Table table)
{
table.CreateInstance<List<Product>>().ForEach(p =>
{
_product = p;
WhenICallThePostMethod();
});
}
示例11: WhenICreateANewBlogPost
public void WhenICreateANewBlogPost(Table table)
{
_post = table.CreateInstance<Post>();
_controller = new PostsController();
_controller.Create(_post);
}
示例12: WhenInputNewRecordAsBelow
public void WhenInputNewRecordAsBelow(Table table)
{
var person = table.CreateInstance<Person>();
WebBrowser.Current.TextField("FirstName").TypeText(person.FirstName);
WebBrowser.Current.TextField("LastName").TypeText(person.LastName);
WebBrowser.Current.TextField("City").TypeText(person.City);
WebBrowser.Current.TextField("Zip").TypeText(person.Zip);
}
示例13: ThenTheRecordWillBeShownAtJqGrid
public void ThenTheRecordWillBeShownAtJqGrid(Table table)
{
var person = table.CreateInstance<Person>();
var tabletext = WebBrowser.Current.Table("list").Text;
tabletext.Should().Contain(person.City);
tabletext.Should().Contain(person.FirstName);
tabletext.Should().Contain(person.LastName);
tabletext.Should().Contain(person.Zip);
}
示例14: InputUserNameAndPassword
public void InputUserNameAndPassword(Table table)
{
var data = table.CreateInstance<AccountData>();
_accountLogonPage = BrowserHelper.Browser.Page<AccountLogonPage>();
_accountLogonPage.UserName = data.UserName;
_accountLogonPage.Password = data.Password;
}
示例15: WhenTheProductCreatedEventIsHandledWithTheFollowingData
public void WhenTheProductCreatedEventIsHandledWithTheFollowingData(Table table)
{
var data = table.CreateInstance<GetDataFromTable>();
var product = new Product(data.AggregateRootId, data.Sku);
var domainRepository = ScenarioContext.Current.Get<IDomainRepository>();
domainRepository.Save(product);
}