当前位置: 首页>>代码示例>>C#>>正文


C# Table.CreateInstance方法代码示例

本文整理汇总了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);
        }
开发者ID:stoiandan,项目名称:MyHome,代码行数:29,代码来源:EditingATransactionSteps.cs

示例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;
            }
        }
开发者ID:stoiandan,项目名称:MyHome,代码行数:35,代码来源:AddingATransactionSteps.cs

示例3: WhenISearchFor

 public void WhenISearchFor(Table table)
 {
     var search = table.CreateInstance<ConstituentSearchCriteria>();
     SearchDialog.SetFirstNameToSearch(search.FirstName);
     SearchDialog.SetLastNameToSearch(search.LastName);
     SearchDialog.Search();
 }
开发者ID:Blackbaud-LucasWestervelt,项目名称:uat-kit,代码行数:7,代码来源:ConstituentSearchSteps.cs

示例4: WhenTheAdministratorSubmitsTheFollowingAdminAccountEditPage

        public void WhenTheAdministratorSubmitsTheFollowingAdminAccountEditPage(Table table)
        {
            var controller = CreateTheController();
            var result = controller.Edit(table.CreateInstance<AdminAccountEditForm>());

            ScenarioContext.Current.Set(result);
        }
开发者ID:burkhartt,项目名称:Bennington,代码行数:7,代码来源:AdminAccountControllerSteps.cs

示例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");
 }
开发者ID:Naviam,项目名称:Shop-Any-Ware,代码行数:7,代码来源:SignInSteps.cs

示例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);
        }
开发者ID:xcyroo,项目名称:InnovationDay.AcceptanceTesting,代码行数:8,代码来源:VerticalDataTableSteps.cs

示例7: WhenBenefitsOptionsOf

        public void WhenBenefitsOptionsOf(Table table)
        {
            var form = table.CreateInstance<AddMembershipProgramBenefitsOptions>();

            AddMembershipProgramDialog.CreateMembershipProgramBenefitsOptionsFormat(form.MembershipFormat);

            AddMembershipProgramDialog.CreateMembershipProgramNext();
        }
开发者ID:Blackbaud-LucasWestervelt,项目名称:uat-kit,代码行数:8,代码来源:MembershipProgramsSteps.cs

示例8: x

        public void x(Table table)
        {
            var form = table.CreateInstance<CreateAccountForm>();

            var controller = new AccountController(Database.Open());

            controller.Create(form);
        }
开发者ID:darrencauthon,项目名称:simple_data_and_specflow_sample,代码行数:8,代码来源:AccountControllerSteps.cs

示例9: WhenIEnterTheFollowingInformation

        public void WhenIEnterTheFollowingInformation(Table enteredInformation)
        {
            var createVm = enteredInformation.CreateInstance<AddKanbanBoardCommand>();
            var controller = CreateController();
            var viewResult = controller.Create(createVm);

            ScenarioContext.Current.Set(viewResult);
        }
开发者ID:marcusoftnet,项目名称:KanbanBoards,代码行数:8,代码来源:KanbanBoardControllerSteps.cs

示例10: GivenIHaveFollowingProducts

 public void GivenIHaveFollowingProducts(Table table)
 {
     table.CreateInstance<List<Product>>().ForEach(p =>
     {
         _product = p;
         WhenICallThePostMethod();
     });
 }
开发者ID:gabrielfbarros,项目名称:supply-manager-product-microservice,代码行数:8,代码来源:ProductControllerSteps.cs

示例11: WhenICreateANewBlogPost

        public void WhenICreateANewBlogPost(Table table)
        {
            _post = table.CreateInstance<Post>();

            _controller = new PostsController();

            _controller.Create(_post);
        }
开发者ID:seantomlins,项目名称:TechEdDev304,代码行数:8,代码来源:BlogPostSteps.cs

示例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);
 }
开发者ID:charreal,项目名称:jqgrid-asp.net-mvc,代码行数:8,代码来源:PageInputting.cs

示例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);
 }
开发者ID:charreal,项目名称:jqgrid-asp.net-mvc,代码行数:9,代码来源:Verification.cs

示例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;
        }
开发者ID:JohnCai,项目名称:agilewizard,代码行数:9,代码来源:AccountSteps.cs

示例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);
        }
开发者ID:JamesTryand,项目名称:Shoon,代码行数:9,代码来源:ProductSteps.cs


注:本文中的TechTalk.SpecFlow.Table.CreateInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。