bdd

Convert C# unit test names to English (testdox style)

橙三吉。 提交于 2019-12-04 15:42:22
I have a whole bunch of unit tests written in MbUnit and I would like to generate plain English sentences from test names. The concept is introduced here: http://dannorth.net/introducing-bdd This is from the article: public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } renders something like this: CustomerLookup - finds customer by id - fails for duplicate customers - ... Unfortunately the tool quoted in the above article (testdox) is Java based. Is there one for .NET? Sounds like this would be something pretty simple

BDD and Behat special characters

↘锁芯ラ 提交于 2019-12-04 14:46:30
There is a similar question @ Gherkin in Behat and input validations scenarios However is not the same. My problem is that I need to had to scenario outlines examples or to arrays Given I have a problem with data | in | this | array | | how | can | I | | add | special | characters | Most of special characters are ok, but wat about quotes and pipes? special characters example: \|!"#$%&/()=?«»'{}[]'`^~*+ºª-_.:,;<>@ł€¶ŧ←↓→øþĸħŋđðßæ|«»¢“”nµ Thanks I know that a year has passed since this was posted, but today had a similar problem and I have posted my solution here . I'm copying it here in case

Rails 4 Paperclip FactoryGirl file uploading

为君一笑 提交于 2019-12-04 13:18:18
问题 I have a FactoryGirl :product factory that uses fixture_file_upload to set image , which is a Paperclip attachment. image { fixture_file_upload "#{Rails.root}/spec/fixtures/images/product.png", 'image/png' } fixture_file_upload works fine, but every time a test creates a new Product using the factory, Paperclip creates a new file in publicproducts/<id>/original.png . This is the issue. . Filling a the folder publicproducts on each test run is not acceptable. The first workaround I can think

How far can you go with JavaScript testing?

旧城冷巷雨未停 提交于 2019-12-04 12:59:35
I'm somewhat informed with TDD and BDD with Ruby/Rails, but I will eventually need to use some form of testing with my JavaScript code. I use MooTools as a JS framework and I absolutely love how well I can organize and modularize my code with its codebase. But, sometimes, when I add new features to my application, I find that the functionality can easily break from how it worked before. When it comes to testing JavaScrtpt code, does the testing itself fall short of user interaction? Is it really only to test the ins and outs of method and (emulated) classes in JavaScript? Or is there a UX

How to debug in Visual Studio with NSpec

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:55:53
how do I debug in visual studio with NSpec? I've resharper installed I need to step into my test code. At least in Visual Studio 2013, the NSpec Test Adapter (by {o} Software) seems to do the trick. Find it in the Extensions gallery. Then just right-click on the test in the Test Explorer and hit Debug. Another good option is to just type System.Diagnostics.Debugger.Launch() in the test you want to debug. You'll get a Visual Studio prompt to debug the test. I would also recommend taking a look at specwatchr . I use a simple trick that let's me debug NSpec with resharper out of the box. The idea

Understanding Behavior Driven Development (BDD)

时光怂恿深爱的人放手 提交于 2019-12-04 09:58:59
问题 From the wikipedia article on BDD: BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. I am not able to make sense of the adjectives used such as "outside-in", "pull-based" and "multiple-scale" even after going through the referred presentation. Please help explain. 回答1: I wrote a blog post

White UIAutomation click() stops working on different platform

折月煮酒 提交于 2019-12-04 09:46:33
I'm using White to automate the BDD testing of our C# WPF UI. My first couple of tests are working well on my development machine (running Windows 7). However, when I try and run the same code on the build server (virtual machine running Windows server 2003 R2) it doesn't work correctly. In both cases the tests are run from the command line and the tests are using the Cuke4Nuke framework. In the case of the server I am accessing the server via Remote Desktop Connection. The code looks like: var application = Application.Launch("whiteApp.exe"); var initializeOption = InitializeOption.NoCache;

Stubbing Chained Methods with Rspec

♀尐吖头ヾ 提交于 2019-12-04 09:20:42
问题 I want to call a named_scope that will only return one record, but the named_scope returns an array, that's not a big deal as I can just chain it with .first: Model.named_scope(param).first and this works, what I am struggling with is how to stub the chained call. Does anyone have a reference or an answer on how I would go about achieving this with Rspec mocking? 回答1: I figured something out. Client.stub!(:named_scope).and_return(@clients = mock([Client])) @clients.stub!(:first).and_return(

How to increase reusability between SpecFlow/Gherkin steps?

佐手、 提交于 2019-12-04 08:39:15
问题 I think I thoroughly understand the concepts and ideas behind SpecFlow, but even after reading the Secret Ninja Cucumber Scrolls, The Cucumber Book, and going through the various forums I'm still unsure about the path to reusability. Our scenarios already comply to various guidelines Self explanatory Must have a understandable purpose (what makes it different from the other scenarios) Are unique Represent vertical functional slices Uses Ubiquitous Language Written from the stakeholder

What's the state of TDD and/or BDD in PHP? [closed]

梦想的初衷 提交于 2019-12-04 07:52:28
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . How widespread, supported, developed is testing in the PHP world? On par with Java? Up there with Ruby/Rails? I Googled and found that testing frameworks