bdd

How to Configure Specflow 3.0.199 with NUnit 3.11?

蓝咒 提交于 2020-01-11 13:57:45
问题 I have done this a couple of times before, but it's not working today. Am I missing something? I want to configure Specflow from the scract, using NUnit and to execute inside Visual Studio. I've seen many tutorials but they are not working to me :P. I'm trying to use the latest versions. These are the steps I'm doing on Visual Studio 2017: Create a test project (.NET Framework) Install Specflow plugin for Visual Studio (Tools > Extensions and Updates) Delete reference of MSTests from the

authlogic flash[:notice] does not show up in cucumber webrat step

拥有回忆 提交于 2020-01-11 13:28:07
问题 I am running BDD steps with cucumber to implement my autlogic login behavior. Scenario: log in Given a registered user: "test@test.com" with password: "p@ssword" exists And I am on the homepage When I follow "Log in" And I fill in "Username" with "test@test.com" And I fill in "Password" with "p@ssword" And I open the page And I press "Login" And I open the page Then I should see "Login successful!" And I should see "Logout" this is my scenario and when I hit Then I should see "Login

关于TDD、BDD和DDD的一些看法

只愿长相守 提交于 2020-01-10 14:44:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在实际的项目中,我们可能随时面对各种不同的需求,它的各个方面的要素决定了我们所采用的开发模式。 比如,它的复杂度如何?所有的需求是否足够清晰?开发人员对相关的业务是否足够了解?项目的工期是否合理?种种问题,不一而足。这也决定了我们可能面对不同的需求可能需要采用不同的开发模式。下面大概说几种。 1. TDD TDD指的是Test Drive Development,很明显的意思是测试驱动开发,也就是说我们可以从测试的角度来检验整个项目。大概的流程是先针对每个功能点抽象出接口代码,然后 编写单元测试代码,接下来实现接口,运行单元测试代码,循环此过程,直到整个单元测试都通过。这一点和敏捷开发有类似之处。 TDD的好处自然不用多说,它能让你减少程序逻辑方面的错误,尽可能的减少项目中的bug,开始接触编程的时候我们大都有过这样的体验,可能你觉得 完成得很完美,自我感觉良好,但是实际测试或者应用的时候才发现里面可能存在一堆bug,或者存在设计问题,或者更严重的逻辑问题,而TDD正好可以帮助 我们尽量减少类似事件的发生。而且现在大行其道的一些模式对TDD的支持都非常不错,比如MVC和MVP等。 但是并不是所有的项目都适合TDD这种模式的,我觉得必须具备以下几个条件。 首先,项目的需求必须足够清晰

关于TDD、BDD和DDD

≡放荡痞女 提交于 2020-01-10 14:43:46
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在实际的项目中,我们可能随时面对各种不同的需求,它的各个方面的要素决定了我们所采用的开发模式。 比如,它的复杂度如何?所有的需求是否足够清晰?开发人员对相关的业务是否足够了解?项目的工期是否合理?种种问题,不一而足。这也决定了我们可能面对不同的需求可能需要采用不同的开发模式。下面大概说几种。 1. TDD TDD指的是Test Drive Development,很明显的意思是测试驱动开发,也就是说我们可以从测试的角度来检验整个项目。大概的流程是先针对每个功能点抽象出接口代码,然后编写单元测试代码,接下来实现接口,运行单元测试代码,循环此过程,直到整个单元测试都通过。这一点和敏捷开发有类似之处。 TDD的好处自然不用多说,它能让你减少程序逻辑方面的错误,尽可能的减少项目中的bug,开始接触编程的时候我们大都有过这样的体验,可能你觉得完成得很完美,自我感觉良好,但是实际测试或者应用的时候才发现里面可能存在一堆bug,或者存在设计问题,或者更严重的逻辑问题,而TDD正好可以帮助我们尽量减少类似事件的发生。而且现在大行其道的一些模式对TDD的支持都非常不错,比如MVC和MVP等。 但是并不是所有的项目都适合TDD这种模式的,我觉得必须具备以下几个条件。 首先,项目的需求必须足够清晰,而且程序员对整个需求有足够的了解

Phpspec No calls have been made that match

时光怂恿深爱的人放手 提交于 2020-01-07 04:13:05
问题 I'm struggling with phpspec and No calls have been made that match while the call was actually made. Here is the code so far: function it_imports_social_feeds( ContainerInterface $container, FacebookManagerFactory $managerFactory, FacebookConnector $facebookConnector, FacebookMapper $facebookMapper, EzContent $ezContent, Collection $feed, Content $content ) { $chainProfiles = []; $container->getParameter('someParam1')->willReturn($chainProfiles); $container->get('someParam2') ->shouldBeCalled

How to partially mock external object

大兔子大兔子 提交于 2020-01-06 19:25:49
问题 I have class method to test with dependant object (Keys object) APIRouter.m + (NSURL*)apiURLWithPath:(NSString*)path { MyKeys *keys = [MyKeys new]; NSString *url = [NSString stringWithFormat:@"%@?api_key=%@", path, [keys APIKey]]; return [NSURL URLWithString:url]; } I am trying to partially mock this Keys object and return "MY_API_KEY" value but the test method fails and returns real API key (e.g. as78d687as6d7das8da). APIRouterSpec.m describe(@"APIRouter", ^{ it(@"should return url for api",

Rspec not logging me in

扶醉桌前 提交于 2020-01-06 14:13:09
问题 I was looking at this answer to see how to test a session controller and wrote something like this: require 'spec_helper' describe SessionsController do context "We should login to the system and create a session" do let :credentials do {:user_name => "MyString", :password => "someSimpleP{ass}"} end let :user do FactoryGirl.create(:user, credentials) end before :each do post :create , credentials end it "should create a session" do puts user.inspect puts session[:user_id] #session[:user_id]

Rspec not logging me in

╄→尐↘猪︶ㄣ 提交于 2020-01-06 14:12:08
问题 I was looking at this answer to see how to test a session controller and wrote something like this: require 'spec_helper' describe SessionsController do context "We should login to the system and create a session" do let :credentials do {:user_name => "MyString", :password => "someSimpleP{ass}"} end let :user do FactoryGirl.create(:user, credentials) end before :each do post :create , credentials end it "should create a session" do puts user.inspect puts session[:user_id] #session[:user_id]

Specs2 - How to define complex objects for Given/When/Then steps

和自甴很熟 提交于 2020-01-06 07:57:23
问题 Specs2's documentation and samples show some codes about the use of Given/Then/When style in an acceptance test. Here one of them: "A given-when-then example for the addition" ^ "Given the following number: ${1}" ^ number1 ^ "And a second number: ${2}" ^ number2 ^ "And a third number: ${3}" ^ number3 val number1: Given[Int] = (_:String).toInt val number2: When[Int, (Int, Int)] = (n1: Int) => (s: String) => (n1, s.toInt) val number3: When[Seq[Int], Seq[Int]] = (numbers: Seq[Int]) => (s: String

Specs2 - How to define complex objects for Given/When/Then steps

笑着哭i 提交于 2020-01-06 07:56:06
问题 Specs2's documentation and samples show some codes about the use of Given/Then/When style in an acceptance test. Here one of them: "A given-when-then example for the addition" ^ "Given the following number: ${1}" ^ number1 ^ "And a second number: ${2}" ^ number2 ^ "And a third number: ${3}" ^ number3 val number1: Given[Int] = (_:String).toInt val number2: When[Int, (Int, Int)] = (n1: Int) => (s: String) => (n1, s.toInt) val number3: When[Seq[Int], Seq[Int]] = (numbers: Seq[Int]) => (s: String