當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。